MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
python.SurrogateModel.SurrogateModel Class Reference
+ Inheritance diagram for python.SurrogateModel.SurrogateModel:

Public Member Functions

def __init__ (self, args, kwargs)
 Constructor. More...
 
def initKwargs (self, kwargs)
 
def parseIndices (self, name)
 Method parsing the name of a function to determine the species, i.e. More...
 
def expandIndices (self, name)
 Method expending the indexes of a function name. More...
 
def expandIndicesWithName (self, name)
 
def outputsToModels (self)
 Method mapping outputs to substitute models. More...
 
def inputsMinMax (self)
 Method determining min and max input taking substitute models into account. More...
 
def inputs_argPos (self, name)
 Method mapping input argument position.
 
def outputs_argPos (self, name)
 Method mapping output argument positions. More...
 
def parameters_argPos (self, name)
 Method mapping parameter argument position. More...
 
def calculate_maps (self, sm)
 Method mapping outputs to inputs wrt. More...
 
def minMax (self)
 Method returning min and max of input variables. More...
 
def updateMinMax (self)
 Method updating min and max values.
 
def error (self, cModel, kwargs)
 Method generating an iterator that yields the error of every. More...
 
def __getattribute__ (self, name)
 Modified magic method. More...
 
def __setattribute__ (self, name, value)
 Modified magic method. More...
 
def exceptionOutOfBounds (self, oPoint)
 Method returning exception when a surrogate function is out of bounds. More...
 
def exceptionLoad (self, surrogateModelId)
 Method returning exception when a surrogate function is not instantiated. More...
 
def exceptionParametersNotValid (self, surrogateModelId)
 Method raising a exception when a surrogate model has no valid parameters after loading it.
 
def callModel (self, inputs)
 Method for calling the surrogate function. More...
 
def updateFitDataFromFwSpec (self, fw_spec)
 Method updating the parameters of the surrogate model. More...
 
def initialisationStrategy (self)
 Method loading the initialisation strategy. More...
 
def load (self, surrogateModelId)
 Method loading a specific surrogate model. More...
 
def loadFailing (self)
 Method returning all objects that have a 'outside point' key.
 
def loadFromModule (self)
 Method importing a surrogate model module. More...
 
def loadParametersNotValid (self)
 Method importing a surrogate model module. More...
 
def get_instances (self)
 Method returning an iterator over all SurrogateModel instances. More...
 
def __repr__ (self)
 

Data Fields

 outsidePoint
 
 nSamples
 

Static Public Attributes

 surrogateFunction = ReferenceField(SurrogateFunction, required=True)
 
 parameters = ListField(FloatField())
 
dictionary meta = {'allow_inheritance': True}
 

Detailed Description

Definition at line 764 of file SurrogateModel.py.

Constructor & Destructor Documentation

◆ __init__()

def python.SurrogateModel.SurrogateModel.__init__ (   self,
  args,
  kwargs 
)

Constructor.

Definition at line 776 of file SurrogateModel.py.

Member Function Documentation

◆ __getattribute__()

def python.SurrogateModel.SurrogateModel.__getattribute__ (   self,
  name 
)

Modified magic method.

Call getattribute from parent class, i.e. DynamocDocument, when accessing instance variables not starting with '___', e.g. ___index___ and ___references___.

Definition at line 1138 of file SurrogateModel.py.

◆ __setattribute__()

def python.SurrogateModel.SurrogateModel.__setattribute__ (   self,
  name,
  value 
)

Modified magic method.

Call setattribute from parent class, i.e. DynamocDocument, when accessing instance variables not starting with '___', e.g. ___index___ and ___references___.

Definition at line 1151 of file SurrogateModel.py.

◆ calculate_maps()

def python.SurrogateModel.SurrogateModel.calculate_maps (   self,
  sm 
)

Method mapping outputs to inputs wrt.

'substitute models'.

Definition at line 1036 of file SurrogateModel.py.

◆ callModel()

def python.SurrogateModel.SurrogateModel.callModel (   self,
  inputs 
)

Method for calling the surrogate function.

Parameters
inputs(dict) inputs to the surrogate model
Returns
outputs (dict) outputs from the surrogate model

Definition at line 1208 of file SurrogateModel.py.

◆ error()

def python.SurrogateModel.SurrogateModel.error (   self,
  cModel,
  kwargs 
)

Method generating an iterator that yields the error of every.

Parameters
cModel(modena_model_t)
kwargsidxGenerator checkBounds
Returns
(iterator) iterator object

Definition at line 1104 of file SurrogateModel.py.

◆ exceptionLoad()

def python.SurrogateModel.SurrogateModel.exceptionLoad (   self,
  surrogateModelId 
)

Method returning exception when a surrogate function is not instantiated.

Todo:
Finding the 'unintialised' models using this method will fail eventually fail when running in parallel. Need to pass id of calling FireTask. However, this requires additional code in the library as well as cooperation of the recipie
Returns
(int) error code

Definition at line 1184 of file SurrogateModel.py.

◆ exceptionOutOfBounds()

def python.SurrogateModel.SurrogateModel.exceptionOutOfBounds (   self,
  oPoint 
)

Method returning exception when a surrogate function is out of bounds.

Returns
(int) error code

Definition at line 1164 of file SurrogateModel.py.

◆ expandIndices()

def python.SurrogateModel.SurrogateModel.expandIndices (   self,
  name 
)

Method expending the indexes of a function name.

Parameters
name(str) name of a function, may or may not contain indexes.
Returns
name

Definition at line 905 of file SurrogateModel.py.

◆ get_instances()

def python.SurrogateModel.SurrogateModel.get_instances (   self)

Method returning an iterator over all SurrogateModel instances.

Definition at line 1323 of file SurrogateModel.py.

◆ initialisationStrategy()

def python.SurrogateModel.SurrogateModel.initialisationStrategy (   self)

Method loading the initialisation strategy.

Definition at line 1263 of file SurrogateModel.py.

◆ inputsMinMax()

def python.SurrogateModel.SurrogateModel.inputsMinMax (   self)

Method determining min and max input taking substitute models into account.

Returns
(dict) dictionary of MinMax objects for each input. Function creating a instance of a 'MinMax' object
(obj) instance of MinMax

Definition at line 957 of file SurrogateModel.py.

◆ load()

def python.SurrogateModel.SurrogateModel.load (   self,
  surrogateModelId 
)

Method loading a specific surrogate model.

Definition at line 1274 of file SurrogateModel.py.

◆ loadFromModule()

def python.SurrogateModel.SurrogateModel.loadFromModule (   self)

Method importing a surrogate model module.

Definition at line 1298 of file SurrogateModel.py.

◆ loadParametersNotValid()

def python.SurrogateModel.SurrogateModel.loadParametersNotValid (   self)

Method importing a surrogate model module.

Definition at line 1314 of file SurrogateModel.py.

◆ minMax()

def python.SurrogateModel.SurrogateModel.minMax (   self)

Method returning min and max of input variables.

Definition at line 1060 of file SurrogateModel.py.

◆ outputs_argPos()

def python.SurrogateModel.SurrogateModel.outputs_argPos (   self,
  name 
)

Method mapping output argument positions.

Definition at line 1006 of file SurrogateModel.py.

◆ outputsToModels()

def python.SurrogateModel.SurrogateModel.outputsToModels (   self)

Method mapping outputs to substitute models.

Returns
(dict) outputs from the surrogate model.

Definition at line 945 of file SurrogateModel.py.

◆ parameters_argPos()

def python.SurrogateModel.SurrogateModel.parameters_argPos (   self,
  name 
)

Method mapping parameter argument position.

Definition at line 1021 of file SurrogateModel.py.

◆ parseIndices()

def python.SurrogateModel.SurrogateModel.parseIndices (   self,
  name 
)

Method parsing the name of a function to determine the species, i.e.

indexes, that are present.

Parameters
name(str) name of a function, may or may not contain indexes.
Returns
(dict)

Definition at line 885 of file SurrogateModel.py.

◆ updateFitDataFromFwSpec()

def python.SurrogateModel.SurrogateModel.updateFitDataFromFwSpec (   self,
  fw_spec 
)

Method updating the parameters of the surrogate model.

Definition at line 1239 of file SurrogateModel.py.


The documentation for this class was generated from the following file: