Skip to content
Snippets Groups Projects
Commit 6dffc922 authored by Stefano Borini's avatar Stefano Borini
Browse files

Added doc

parent e8044a0a
No related branches found
No related tags found
1 merge request!60Moved parameters into MCO
...@@ -7,8 +7,12 @@ class BaseMCOParameterFactory(HasStrictTraits): ...@@ -7,8 +7,12 @@ class BaseMCOParameterFactory(HasStrictTraits):
"""Factory that produces the model instance of a given BASEMCOParameter """Factory that produces the model instance of a given BASEMCOParameter
instance. instance.
Must be reimplemented for the specific parameter.""" Must be reimplemented for the specific parameter. The generic create_model
is generally enough, and the only entity to define is model_class with
the appropriate class of the parameter.
"""
#: A reference to the bundle this parameter factory lives in.
bundle = Instance(BaseMCOBundle) bundle = Instance(BaseMCOBundle)
#: A unique string identifying the parameter #: A unique string identifying the parameter
...@@ -29,6 +33,18 @@ class BaseMCOParameterFactory(HasStrictTraits): ...@@ -29,6 +33,18 @@ class BaseMCOParameterFactory(HasStrictTraits):
def create_model(self, data_values=None): def create_model(self, data_values=None):
"""Creates the instance of the model class and returns it. """Creates the instance of the model class and returns it.
You should not reimplement this, as the default is generally ok.
Instead, just define model_class with the appropriate Parameter class.
Parameters
----------
data_values: dict or None
The dictionary of values for this parameter. If None, a default
object will be returned.
Returns
-------
instance of model_class.
""" """
if data_values is None: if data_values is None:
data_values = {} data_values = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment