Skip to content

Commit

Permalink
Remove unnecessary calls to logger.info()
Browse files Browse the repository at this point in the history
Remove unnecessary calls to logger.info(), as check_call already
takes care of writing the commands to the log file.
  • Loading branch information
trhille committed Apr 11, 2023
1 parent 8b327bd commit 342856f
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions compass/landice/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,14 +621,13 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,
logger.info('writing grid_converted.nc')
write_netcdf(dsMesh, 'grid_converted.nc')
levels = section.get('levels')
logger.info('calling create_landice_grid_from_generic_MPAS_grid.py')
args = ['create_landice_grid_from_generic_MPAS_grid.py',
'-i', 'grid_converted.nc',
'-o', 'grid_preCull.nc',
'-l', levels, '-v', 'glimmer']

check_call(args, logger=logger)

logger.info('calling interpolate_to_mpasli_grid.py')
args = ['interpolate_to_mpasli_grid.py', '-s',
gridded_dataset, '-d',
'grid_preCull.nc', '-m', 'b', '-t']
Expand All @@ -637,7 +636,6 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,

cullDistance = section.get('cull_distance')
if float(cullDistance) > 0.:
logger.info('calling define_cullMask.py')
args = ['define_cullMask.py', '-f',
'grid_preCull.nc', '-m',
'distance', '-d', cullDistance]
Expand All @@ -650,13 +648,11 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,
if geojson_file is not None:
# This step is only necessary because the GeoJSON region
# is defined by lat-lon.
logger.info('calling set_lat_lon_fields_in_planar_grid.py')
args = ['set_lat_lon_fields_in_planar_grid.py', '-f',
'grid_preCull.nc', '-p', projection]

check_call(args, logger=logger)

logger.info('calling MpasMaskCreator.x')
args = ['MpasMaskCreator.x', 'grid_preCull.nc',
'mask.nc', '-f', geojson_file]

Expand All @@ -675,6 +671,7 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,

logger.info('Marking horns for culling')
args = ['mark_horns_for_culling.py', '-f', 'culled.nc']

check_call(args, logger=logger)

logger.info('culling and converting')
Expand All @@ -683,25 +680,23 @@ def build_mali_mesh(self, cell_width, x1, y1, geom_points,
dsMesh = convert(dsMesh, logger=logger)
write_netcdf(dsMesh, 'dehorned.nc')

logger.info('calling create_landice_grid_from_generic_MPAS_grid.py')
args = ['create_landice_grid_from_generic_MPAS_grid.py', '-i',
'dehorned.nc', '-o',
mesh_name, '-l', levels, '-v', 'glimmer',
'--beta', '--thermal', '--obs', '--diri']

check_call(args, logger=logger)

logger.info('calling interpolate_to_mpasli_grid.py')
args = ['interpolate_to_mpasli_grid.py', '-s',
gridded_dataset, '-d', mesh_name, '-m', 'b']

check_call(args, logger=logger)

logger.info('Marking domain boundaries dirichlet')
args = ['mark_domain_boundaries_dirichlet.py',
'-f', mesh_name]
check_call(args, logger=logger)

logger.info('calling set_lat_lon_fields_in_planar_grid.py')
args = ['set_lat_lon_fields_in_planar_grid.py', '-f',
mesh_name, '-p', projection]
check_call(args, logger=logger)
Expand Down

0 comments on commit 342856f

Please sign in to comment.