|
carputils
Doxygen code documentation for the python framework controlling openCARP
|
Describes a set of parameters that can be generated into a single string. More...
Public Member Functions | |
| def | __init__ (self, parameters) |
| def | assign (self, values) |
| Assign the provided parameter values. More... | |
| def | pop_and_assign (self, values) |
| Remove and assign any matching parameters from a provided dict. More... | |
| def | __str__ (self) |
| Generate the material parameter string for this model. More... | |
Describes a set of parameters that can be generated into a single string.
This class is essentially a wrapper for a dictionary, with the following features:
parameters list A list of allowed parameter names for this parameter set
| def carputils.model.general.ParameterSet.__init__ | ( | self, | |
| parameters | |||
| ) |
| def carputils.model.general.ParameterSet.__str__ | ( | self | ) |
Generate the material parameter string for this model.
Returns
-------
str
The parameter string
| def carputils.model.general.ParameterSet.assign | ( | self, | |
| values | |||
| ) |
Assign the provided parameter values.
This method will attempt to assign all provided values, and will cause an error if an invalid parameter name is passed. Parameters ----------
values dict The parameter values to assign
| def carputils.model.general.ParameterSet.pop_and_assign | ( | self, | |
| values | |||
| ) |
Remove and assign any matching parameters from a provided dict.
This method is more error-tolerant than `assign`. Instead of trying to assign all parameters, any non-matching ones are simply ignored (and are left in the dict for further processing by the caller). Parameters ----------
values dict The parameter values to assign