From 568b29b266418be1499e879898b186ed18284e31 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Mon, 21 Nov 2022 17:11:11 -0500 Subject: [PATCH] Added check for unrecognized arguments --- python/swiftest/swiftest/simulation_class.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/swiftest/swiftest/simulation_class.py b/python/swiftest/swiftest/simulation_class.py index 113bab9a9..e4dae6068 100644 --- a/python/swiftest/swiftest/simulation_class.py +++ b/python/swiftest/swiftest/simulation_class.py @@ -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