Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Added check for unrecognized arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Nov 21, 2022
1 parent adb4ea3 commit 568b29b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,11 @@ def set_parameter(self, verbose: bool = True, **kwargs):
if len(kwargs) == 0:
kwargs = default_arguments

unrecognized = [k for k,v in kwargs.items() if k not in default_arguments]
if len(unrecognized) > 0:
for k in unrecognized:
warnings.warn(f'Unrecognized argument "{k}"',stacklevel=2)

# Add the verbose flag to the kwargs for passing down to the individual setters
kwargs["verbose"] = verbose

Expand Down

0 comments on commit 568b29b

Please sign in to comment.