Skip to content

Commit

Permalink
Merge pull request #147 from HERA-Team/fix-default-dlst
Browse files Browse the repository at this point in the history
fix: some config entries that aren't required but have default None
  • Loading branch information
steven-murray authored Sep 21, 2023
2 parents 031375b + f727082 commit bba04b8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions hera_opm/mf_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1487,8 +1487,10 @@ def build_lstbin_makeflow_from_config(

# Get dlst. Updated version supports leaving dlst unspecified or set as null.
# To support older versions which required string 'None', set that to None here.
dlst = get_config_entry(config, "LSTBIN_OPTS", "dlst")
if dlst.lower() == "none":
dlst = get_config_entry(
config, "LSTBIN_OPTS", "dlst", default=None, required=False
)
if isinstance(dlst, str) and dlst.lower() in ("none", "null", ""):
warnings.warn(
"dlst should not be set to (string) 'None', but rather left unspecified in your TOML.",
DeprecationWarning,
Expand All @@ -1497,7 +1499,9 @@ def build_lstbin_makeflow_from_config(

clobber = get_config_entry(config, "LSTBIN_OPTS", "overwrite", default=False)
atol = get_config_entry(config, "LSTBIN_OPTS", "atol", default=1e-10)
lst_start = get_config_entry(config, "LSTBIN_OPTS", "lst_start", default=None)
lst_start = get_config_entry(
config, "LSTBIN_OPTS", "lst_start", default=None, required=False
)
lst_width = get_config_entry(
config, "LSTBIN_OPTS", "lst_width", default=2 * math.pi
)
Expand Down

0 comments on commit bba04b8

Please sign in to comment.