Model

class ompy.Model(name, _Model__isfrozen=False)[source]

Bases: object

Dataclass for Model

Variables:

Name – Name of the class (for printing etc.)

Methods Summary

asdict()

return fields and properties as dict

get_parameters()

Returns a list of the names of the paramters

is_changed([include, exclude])

Verify that defaults arguments have been changed

load(path)

Loads own parameters from path

save(path)

Save the model parameters to path

Methods Documentation

asdict()[source]

return fields and properties as dict

Return type:

Dict[str, Any]

get_parameters()[source]

Returns a list of the names of the paramters

Return type:

List[str]

is_changed(include=[], exclude=[])[source]

Verify that defaults arguments have been changed

Parameters:
  • include (List[str], optional) – List of attribute names be included in the check. Default is all attributes.

  • exclude (List[str], optional) – List of attribute names to exclude be excluded from check. Default is none

Raises:

ValueError – If parameters are still the default values

Return type:

None

load(path)[source]

Loads own parameters from path

Parameters:

path (Union[str, Path]) – Path to pickled file

Raises:

IOError – Path doesn’t exist

Return type:

None

save(path)[source]

Save the model parameters to path

Parameters:

path (Union[str, Path]) – The path

Return type:

None