From 5f249ec2269e86fa7aacca43e13217cd15692f89 Mon Sep 17 00:00:00 2001 From: Carolyn Begeman Date: Wed, 21 Jul 2021 09:28:07 -0600 Subject: [PATCH] Fix PEP8 style issues --- compass/ocean/inactive_top_cells.py | 2 +- .../ocean/tests/global_ocean/init/initial_state.py | 11 +++++++---- .../tests/global_ocean/performance_test/__init__.py | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/compass/ocean/inactive_top_cells.py b/compass/ocean/inactive_top_cells.py index f19b841709..fff8a311e1 100644 --- a/compass/ocean/inactive_top_cells.py +++ b/compass/ocean/inactive_top_cells.py @@ -23,6 +23,6 @@ def remove_inactive_top_cells_output(in_filename, inactive_top_cells=1): out_filename = in_filename.split('.')[0] + '_crop.nc' with xarray.open_dataset(in_filename) as ds_in: - ds_out = ds_in.isel(nVertLevels=slice(1,None)) + ds_out = ds_in.isel(nVertLevels=slice(1, None)) write_netcdf(ds_out, out_filename) diff --git a/compass/ocean/tests/global_ocean/init/initial_state.py b/compass/ocean/tests/global_ocean/init/initial_state.py index 5e5ecbd1d3..0c7cbe30f0 100644 --- a/compass/ocean/tests/global_ocean/init/initial_state.py +++ b/compass/ocean/tests/global_ocean/init/initial_state.py @@ -185,14 +185,17 @@ def run(self): ds = ds.isel(Time=0) if ('minLevelCell' in ds): - if config.has_option('vertical_grid', 'inactive_top_cells'): - offset = config.getint('vertical_grid', 'inactive_top_cells') + if config.has_option('vertical_grid', + 'inactive_top_cells'): + offset = config.getint('vertical_grid', + 'inactive_top_cells') minLevelCell = ds.minLevelCell+offset ds_out['minLevelCell'] = minLevelCell else: logger.info(" - Streams missing for inactive top cells") - - remove_inactive_top_cells_output(in_filename, inactive_top_cells=offset) + + remove_inactive_top_cells_output(in_filename, + inactive_top_cells=offset) write_netcdf(ds_out, out_filename) logger.info(" - Complete") diff --git a/compass/ocean/tests/global_ocean/performance_test/__init__.py b/compass/ocean/tests/global_ocean/performance_test/__init__.py index 2845cb991f..78ddb3f5a8 100644 --- a/compass/ocean/tests/global_ocean/performance_test/__init__.py +++ b/compass/ocean/tests/global_ocean/performance_test/__init__.py @@ -67,8 +67,8 @@ def validate(self): if offset > 0: remove_inactive_top_cells_output('forward/output.nc', inactive_top_cells=offset) - variables = [ - 'temperature', 'salinity', 'layerThickness', 'normalVelocity'] + variables = ['temperature', 'salinity', 'layerThickness', + 'normalVelocity'] compare_variables(test_case=self, variables=variables, filename1='forward/output_crop.nc', filename2='forward/output_comp.nc',