From 1cc9745477c9dd3b0d86931cf83c5656d4cb88a9 Mon Sep 17 00:00:00 2001 From: David Minton Date: Wed, 9 Nov 2022 19:55:07 -0500 Subject: [PATCH] return dictionary from set_parameter. Renamed from parameters -> parameter in getter and setter --- python/swiftest/swiftest/simulation_class.py | 32 +++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/python/swiftest/swiftest/simulation_class.py b/python/swiftest/swiftest/simulation_class.py index b7f948d2d..7b043e8ca 100644 --- a/python/swiftest/swiftest/simulation_class.py +++ b/python/swiftest/swiftest/simulation_class.py @@ -249,7 +249,7 @@ def __init__(self, else: print(f"{param_file} not found.") - self.set_parameters(t0=t0, + self.set_parameter(t0=t0, tstart=tstart, tstop=tstop, dt=dt, @@ -364,7 +364,7 @@ def set_simulation_time(self, If passed, it will override the Simulation object's verbose flag **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - set_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + set_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns ------- @@ -463,7 +463,7 @@ def get_simulation_time(self, arg_list: str | List[str] | None = None, verbose: If passed, it will override the Simulation object's verbose flag **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - get_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + get_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns @@ -513,7 +513,7 @@ def get_simulation_time(self, arg_list: str | List[str] | None = None, verbose: return time_dict - def set_parameters(self, **kwargs): + def set_parameter(self, **kwargs): """ Setter for all possible parameters. Calls each of the specialized setters using keyword arguments Parameters @@ -532,7 +532,9 @@ def set_parameters(self, **kwargs): param_dict.update(self.set_output_files(**kwargs)) param_dict.update(self.set_simulation_time(**kwargs)) - def get_parameters(self, **kwargs): + return param_dict + + def get_parameter(self, **kwargs): """ Setter for all possible parameters. Calls each of the specialized setters using keyword arguments Parameters @@ -631,7 +633,7 @@ def set_feature(self, If passed, it will override the Simulation object's verbose flag **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - set_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + set_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns ------- @@ -719,7 +721,7 @@ def get_feature(self, arg_list: str | List[str] | None = None, verbose: bool | N If passed, it will override the Simulation object's verbose flag **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - get_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + get_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns ------- @@ -791,7 +793,7 @@ def set_init_cond_files(self, If passed, it will override the Simulation object's verbose flag **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - set_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + set_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns ------- @@ -903,7 +905,7 @@ def get_init_cond_files(self, arg_list: str | List[str] | None = None, verbose: If passed, it will override the Simulation object's verbose flag **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - get_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + get_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns @@ -990,7 +992,7 @@ def set_output_files(self, If passed, it will override the Simulation object's verbose flag **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - set_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + set_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns ------- @@ -1071,7 +1073,7 @@ def get_output_files(self, arg_list: str | List[str] | None = None, verbose: boo If passed, it will override the Simulation object's verbose flag **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - get_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + get_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns @@ -1171,7 +1173,7 @@ def set_unit_system(self, If passed, it will override the Simulation object's verbose flag **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - set_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + set_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns ---------- @@ -1289,7 +1291,7 @@ def get_unit_system(self, arg_list: str | List[str] | None = None, verbose: bool ["MU", "DU", "TU"] **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - get_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + get_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns ------- @@ -1402,7 +1404,7 @@ def set_distance_range(self, Maximum distance of the simulation (CHK_RMAX, CHK_QMIN_RANGE[1]) **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - set_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + set_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns ------- @@ -1448,7 +1450,7 @@ def get_distance_range(self, arg_list: str | List[str] | None = None, verbose: b ["rmin", "rmax"] **kwargs A dictionary of additional keyword argument. This allows this method to be called by the more general - get_parameters method, which takes all possible Simulation parameters as arguments, so these are ignored. + get_parameter method, which takes all possible Simulation parameters as arguments, so these are ignored. Returns -------