bout_runners.parameters.run_parameters¶
Contains the class dealing with the run parameters.
Classes
|
Class which deals with run parameters with precedence over BOUT.inp. |
-
class
bout_runners.parameters.run_parameters.
RunParameters
(run_parameters_dict: Optional[Dict[str, Dict[str, Union[int, float, bool, str]]]] = None)[source]¶ Class which deals with run parameters with precedence over BOUT.inp.
Examples
>>> run_parameters = RunParameters({'mesh': {'nx': 4}}) >>> run_parameters.run_parameters_str 'mesh.nx=4 '
>>> run_parameters.run_parameters_str = 'foo' Traceback (most recent call last): File "<input>", line 1, in <module> AttributeError: The run_parameters_str is read only, and is set internally in the setter of run_parameters_dict
- Attributes
- __run_parameters_dictNone or dict
Getter and setter variable for run_parameters_dict
- __run_parameters_strNone or str
Getter and setter variable for run_parameters_str
run_parameters_dict
dictSet the properties of self.run_parameters_dict.
run_parameters_str
None or strSet the properties of self.run_parameters_str.
Set the parameters.
- Parameters
- run_parameters_dictNone or dict
Options on the form
>>> {'global': {'append': False, 'nout': 5}, ... 'mesh': {'nx': 4}, ... 'section_in_BOUT_inp': {'some_variable': 'some_value'}}
Notes
The parameters set here will override those found in the BOUT.inp file
- Attributes
run_parameters_dict
Set the properties of self.run_parameters_dict.
run_parameters_str
Set the properties of self.run_parameters_str.
-
property
run_parameters_dict
¶ Set the properties of self.run_parameters_dict.
The setter will also create the self.__run_parameters_str The run_parameters_dict should be set on the form
>>> {'global': {'append': False, 'nout': 5}, ... 'mesh': {'nx': 4}, ... 'section_in_BOUT_inp': {'some_variable': 'some_value'}}
- Returns
- self.__run_parameters_dictdict of str, dict
Absolute path to the root of make file
- Raises
- RuntimeError
If self.run_parameters_dict is None
-
property
run_parameters_str
¶ Set the properties of self.run_parameters_str.
- Returns
- str
The parameters dict serialized as a string
- Raises
- RuntimeError
If self.__run_parameters_str is None
Notes
As the run_parameters_str must reflect run_parameters_dict, both are set when setting run_parameters_dict