Parameter

class uncertainpy.Parameter(name, value=None, distribution=None)[source]

Parameter object, contains name of parameter, value of parameter and distribution of parameter.

Parameters:
  • name (str) – Name of the parameter.
  • value (float, int, None) – The fixed value of the parameter. If you give a parameter a distribution, in most cases you do not need to give it a fixed value.
  • distribution ({None, Chaospy distribution, Function that returns a Chaospy distribution}, optional) – The distribution of the parameter. A parameter is considered uncertain if it has a distribution. Defaults to None.
Variables:
  • name (str) – Name of the parameter.
  • value (float, int) – The value of the parameter.
  • distribution (uncertainpy.Parameter.distribution) – The distribution of the parameter. A parameter is considered uncertain if it has a distribution.
__str__()[source]

Return a readable string describing the parameter.

Returns:A string containing name, value, and if a parameter is uncertain.
Return type:str
distribution

A Chaospy distribution or a function that returns a Chaospy distribution. If None the parameter has no distribution and is not considered uncertain.

Parameters:distribution ({None, Chaospy distribution, callable that returns a Chaospy distribution}, optional) – The distribution of the parameter, used if the parameter is uncertain If it is a callable that returns a Chaospy distribution, the function sends value value to the function. Defaults to None.
Returns:distribution – The distribution of the parameter, if None the parameter has no distribution and is not considered uncertain.
Return type:{Chaospy distribution, None}
reset_parameter_file(filename)[source]

Set all parameters to the original value in the parameter file, filename.

Parameters:filename (str) – Name of file.
set_parameter_file(filename, value)[source]

Set parameters to given value in a parameter file.

Search filename for occurrences of name = number and replace number with value.

Parameters:
  • filename (str) – Name of file.
  • value (float, int) – New value to set in parameter file.