Skip to content

Commit

Permalink
pylint recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
slevis-lmwg committed Nov 30, 2021
1 parent 8afbfa4 commit c83c269
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion python/ctsm/modify_fsurdat/fsurdat_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
The wrapper script includes a full description and instructions.
"""

import sys
import logging
import argparse
from configparser import ConfigParser
Expand Down
2 changes: 0 additions & 2 deletions python/ctsm/test/test_sys_fsurdat_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
import tempfile
import shutil
from subprocess import check_call
from configparser import ConfigParser

import xarray as xr

import ctsm.unit_testing
from ctsm.utils import get_config_value, fill_template_file
from ctsm.path_utils import path_to_ctsm_root


Expand Down
9 changes: 4 additions & 5 deletions python/ctsm/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def get_ctsm_git_sha():
"""
Returns Git short SHA for the ctsm directory.
"""
return subprocess.check_output(['git', '-C', path_to_ctsm_root(), 'rev-parse', '--short', 'HEAD']).strip().decode()
return subprocess.check_output(['git', '-C', path_to_ctsm_root(),
'rev-parse', '--short', 'HEAD']).strip().decode()

def add_tag_to_filename(filename, tag):
"""
Expand Down Expand Up @@ -133,9 +134,8 @@ def lon_range_0_to_360(lon_in):
"""
if -180 <= lon_in < 0:
lon_out = lon_in + 360
message = 'INFO: Resetting longitude from ' + str(lon_in) + \
' to ' + str(lon_out) + ' to keep in the range 0 to 360'
print(message) # TODO Use logging to print this
logger.info('Resetting longitude from %s to %s to keep in the range ' \
' 0 to 360', str(lon_in), str(lon_out))
elif 0 <= lon_in <= 360 or lon_in is None:
lon_out = lon_in
else:
Expand Down Expand Up @@ -204,7 +204,6 @@ def _handle_config_value(var, default, item, is_list, convert_to_type,
except ValueError:
abort('Wrong type for .cfg file variable: {}'.format(item))

# TODO prelim. testing of this abort: errmsg didn't come through upon FAIL
if allowed_values is not None:
for v in var:
if v not in allowed_values:
Expand Down

0 comments on commit c83c269

Please sign in to comment.