Skip to content

Commit

Permalink
Fix PEP8 style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Jul 21, 2021
1 parent 5280ea3 commit 5f249ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion compass/ocean/inactive_top_cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
11 changes: 7 additions & 4 deletions compass/ocean/tests/global_ocean/init/initial_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions compass/ocean/tests/global_ocean/performance_test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 5f249ec

Please sign in to comment.