Skip to content
Snippets Groups Projects

Moved parameters into MCO

Merged Adham Hashibon requested to merge move-parameters-to-mco into master
1 file
+ 17
1
Compare changes
  • Side-by-side
  • Inline
@@ -7,8 +7,12 @@ class BaseMCOParameterFactory(HasStrictTraits):
"""Factory that produces the model instance of a given BASEMCOParameter
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)
#: A unique string identifying the parameter
@@ -29,6 +33,18 @@ class BaseMCOParameterFactory(HasStrictTraits):
def create_model(self, data_values=None):
"""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:
data_values = {}
Loading