Base and ParameterBase

These classes enable setting and updating the model, features and parameters (not in all classes) across classes from the top of the hierarchy (UncertaintyQuantification) and down (Parallel). To add updating of the current class, as well as the classes further down the setters can be overridden. One example of this from RunModel):

@ParameterBase.model.setter
def model(self, new_model):
    ParameterBase.model.fset(self, new_model)

    self._parallel.model = self.model

API Reference

Base

class uncertainpy.core.Base(model=None, features=None, logger_level=u'info')[source]

Set and update features and model.

Parameters:
  • model ({None, Model or Model subclass instance, model function}, optional) – Model to perform uncertainty quantification on. For requirements see Model.run. Default is None.
  • features ({None, Features or Features subclass instance, list of feature functions}, optional) – Features to calculate from the model result. If None, no features are calculated. If list of feature functions, all listed features will be calculated. Default is None.
  • logger_level ({“info”, “debug”, “warning”, “error”, “critical”, None}, optional) – Set the threshold for the logging level. Logging messages less severe than this level is ignored. If None, no logging is performed. Default logger level is “info”.
Variables:
  • model (uncertainpy.Model or subclass of uncertainpy.Model) – The model to perform uncertainty quantification on.
  • features (uncertainpy.Features or subclass of uncertainpy.Features) – The features of the model to perform uncertainty quantification on.

See also

uncertainpy.features.Features, uncertainpy.models.Model

uncertainpy.models.Model.run
Requirements for the model run function.
features

Features to calculate from the model result.

Parameters:new_features ({None, Features or Features subclass instance, list of feature functions}) – Features to calculate from the model result. If None, no features are calculated. If list of feature functions, all will be calculated.
Returns:features – Features to calculate from the model result. If None, no features are calculated.
Return type:{None, Features object}
model

Model to perform uncertainty quantification on. For requirements see Model.run.

Parameters:new_model ({None, Model or Model subclass instance, model function}) – Model to perform uncertainty quantification on.
Returns:model – Model to perform uncertainty quantification on.
Return type:Model or Model subclass instance

ParameterBase

class uncertainpy.core.ParameterBase(model=None, parameters=None, features=None, logger_level=u'info')[source]

Set and update features, model and parameters.

Parameters:
  • model ({None, Model or Model subclass instance, model function}, optional) – Model to perform uncertainty quantification on. For requirements see Model.run. Default is None.

  • parameters ({dict {name: parameter_object}, dict of {name: value or Chaospy distribution}, …], list of Parameter instances, list [[name, value or Chaospy distribution], …], list [[name, value, Chaospy distribution or callable that returns a Chaospy distribution],…],}) – List or dictionary of the parameters that should be created. On the form parameters =

    • {name_1: parameter_object_1, name: parameter_object_2, ...}
    • {name_1:  value_1 or Chaospy distribution, name_2:  value_2 or Chaospy distribution, ...}
    • [parameter_object_1, parameter_object_2, ...],
    • [[name_1, value_1 or Chaospy distribution], ...].
    • [[name_1, value_1, Chaospy distribution or callable that returns a Chaospy distribution], ...]
  • features ({None, Features or Features subclass instance, list of feature functions}, optional) – Features to calculate from the model result. If None, no features are calculated. If list of feature functions, all will be calculated. Default is None.

  • logger_level ({“info”, “debug”, “warning”, “error”, “critical”}, optional) – Set the threshold for the logging level. Logging messages less severe than this level is ignored. Default is “info”.

Variables:
  • model (Model or Model subclass) – The model to perform uncertainty quantification on.
  • parameters (Parameters) – The uncertain parameters.
  • features (Features or subclass of Features) – The features of the model to perform uncertainty quantification on.
  • logger_level ({"info", "debug", "warning", "error", "critical", None}) – Set the threshold for the logging level. Logging messages less severe than this level is ignored. If None, no logging is performed.

See also

uncertainpy.features.Features, uncertainpy.models.Model

uncertainpy.models.Model.run
Requirements for the model run function.
features

Features to calculate from the model result.

Parameters:new_features ({None, Features or Features subclass instance, list of feature functions}) – Features to calculate from the model result. If None, no features are calculated. If list of feature functions, all will be calculated.
Returns:features – Features to calculate from the model result. If None, no features are calculated.
Return type:{None, Features object}
model

Model to perform uncertainty quantification on. For requirements see Model.run.

Parameters:new_model ({None, Model or Model subclass instance, model function}) – Model to perform uncertainty quantification on.
Returns:model – Model to perform uncertainty quantification on.
Return type:Model or Model subclass instance
parameters

Model parameters.

Parameters:new_parameters ({None, Parameters instance, list of Parameter instances, list [[name, value, distribution], …]}) – Either None, a Parameters instance or a list of the parameters that should be created. The two lists are similar to the arguments sent to Parameters. Default is None.
Returns:parameters – Parameters of the model. If None, no parameters have been set.
Return type:{None, Parameters}