Skip to content

Commit

Permalink
Merge pull request #4 from billsacks/python_dev_meeting
Browse files Browse the repository at this point in the history
Changes by Bill Sacks
  • Loading branch information
negin513 authored Feb 10, 2022
2 parents dbc48b7 + d09113d commit e501e4b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions python/ctsm/args_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ def plon_type(plon):
Returns:
plon_out (float): converted longitude between 0 and 360
"""
plon = float(plon)
if plon < -180 or plon > 360:
plon_float = float(plon)
if plon_float < -180 or plon_float > 360:
raise argparse.ArgumentTypeError(
"ERROR: Longitude should be between 0 and 360 or -180 and 180."
)
plon_out = lon_range_0_to_360(plon)
plon_out = lon_range_0_to_360(plon_float)
return plon_out
4 changes: 2 additions & 2 deletions python/ctsm/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ def _convert_to_bool(var):
Returns:
var_out (bool): Boolean value corresponding to the input.
"""
if var.lower() in ("yes", "true", "t", "y", "1"):
if var.lower() in ("yes", "true", "t", "y", "1", "on"):
var_out = True
elif var.lower() in ("no", "false", "f", "n", "0"):
elif var.lower() in ("no", "false", "f", "n", "0", "off"):
var_out = False
else:
raise ValueError("Boolean value expected. [true or false] or [y or n]")
Expand Down
8 changes: 4 additions & 4 deletions python/ctsm/git_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

def get_ctsm_git_short_hash():
"""
Returns Git short SHA for the currect directory.
Returns Git short SHA for the CTSM repository.
Args:
Expand All @@ -30,7 +30,7 @@ def get_ctsm_git_short_hash():

def get_ctsm_git_long_hash():
"""
Returns Git long SHA for the currect directory.
Returns Git long SHA for the CTSM repository.
Args:
Expand All @@ -49,14 +49,14 @@ def get_ctsm_git_long_hash():

def get_ctsm_git_describe():
"""
Function for giving the recent tag of the git repo
Function for giving the recent tag of the CTSM repository
Args:
Raises:
Returns:
label (str) : ouput of running 'git describe' in shell
label (str) : ouput of running 'git describe' for the CTSM repository
"""
label = (
subprocess.check_output(["git", "-C", path_to_ctsm_root(), "describe"])
Expand Down

0 comments on commit e501e4b

Please sign in to comment.