Skip to content

Commit

Permalink
Merge pull request #228 from simonsobs/param-check-bug-fix
Browse files Browse the repository at this point in the history
Only perform check on param if value is given
  • Loading branch information
BrianJKoopman committed Sep 22, 2021
2 parents 2d1f1c6 + de1401f commit 13be6e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ocs/ocs_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1164,9 +1164,9 @@ def get(self, key, default=ParamError(''), check=None, cast=None, type=None,
if choices is not None:
if value not in choices:
raise ParamError(f"Param '{key}'={value} is not in allowed set ({choices})")
if check is not None:
if not check(value):
raise ParamError(f"Param '{key}' failed validity check (see docs?).")
if check is not None:
if not check(value):
raise ParamError(f"Param '{key}' failed validity check (see docs?).")
return value

def batch(self, instructions, check_for_strays=True):
Expand Down

0 comments on commit 13be6e8

Please sign in to comment.