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

Commit

Permalink
Browse files Browse the repository at this point in the history
return dictionary from set_parameter. Renamed from parameters -> parameter in getter and setter
  • Loading branch information
daminton committed Nov 10, 2022
1 parent 69807af commit 1cc9745
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
----------
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
-------
Expand Down Expand Up @@ -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
-------
Expand Down

0 comments on commit 1cc9745

Please sign in to comment.