modelrunner.model.base module
Base class describing a model
- class ModelBase(parameters=None, output=None, *, mode='insert', strict=False)[source]
Bases:
Parameterized
base class for describing models
initialize the parameters of the object
- Parameters:
parameters (dict) – A dictionary of parameters to change the defaults of this model. The allowed parameters can be obtained from
get_parameters()
or displayed by callingshow_parameters()
.output (str) – Path where the output file will be written. The output will be written using
storage
and might contain two groups: result to which the final result of the model is written, and data, which can contain extra information that is written usingstorage
.mode (str or
ModeType
) – The file mode with which the storage is accessed, which determines the allowed operations. Common options are “read”, “full”, “append”, and “truncate”.strict (bool) – Flag indicating whether parameters are strictly interpreted. If True, only parameters listed in parameters_default can be set and their type will be enforced.
- classmethod from_command_line(args=None, name=None)[source]
create model from command line parameters
- get_result(data=None)[source]
get the result as a
Result
object- Parameters:
data (Any) – The result data. If omitted, the model is run to obtain results
- Returns:
The result after the model is run
- Return type:
Result
- classmethod run_from_command_line(args=None, name=None)[source]
run model using command line parameters
- property storage: StorageGroup
Storage to which data can be written
- Type:
StorageGroup