pymecht.ParamDict module
- class pymecht.ParamDict.Param(value: float = 0.0, low: float = -inf, high: float = inf, fixed: bool = False)[source]
Bases:
objectA data structure for a single parameter. ParamDict is a dictionary of Param objects.
This class is used internally by ParamDict and is not intended to be used directly by the user.
- class pymecht.ParamDict.ParamDict(mapping=None, /, **kwargs)[source]
Bases:
dictA custom dictionary for storing parameters. The keys are strings and the values are Param objects. The mat_model.parameters and sample_experiment.parameters are instances of ParamDict.
- update([E, ]**F) None. Update D from dict/iterable E and F.[source]
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- fix(k: str, x=None)[source]
Fix a parameter
- Parameters:
k (str) – Key of the parameter to be fixed
x (float, optional) – Value of the parameter to be fixed to. If not provided, the current value is used.
- Return type:
None
- set(k: str, x: float)[source]
Set the value of a parameter
- Parameters:
k (str) – Key of the parameter to be set
x (float) – Value of the parameter
- Return type:
None
- set_lb(k: str, x: float)[source]
Set the lower bound of a parameter
- Parameters:
k (str) – Key of the parameter to be set
x (float) – Lower bound of the parameter
- Return type:
None
- set_ub(k: str, x: float)[source]
Set the upper bound of a parameter
- Parameters:
k (str) – Key of the parameter to be set
x (float) – Upper bound of the parameter
- Return type:
None
- to_pandas()[source]
Convert the parameters to a pandas DataFrame
- Returns:
DataFrame containing the parameters
- Return type:
pandas.DataFrame