simpleml.registries

Import path for the different registries available

Submodules

Package Contents

Classes

DatasetRegistry

Meta class to register SimpleML persistables. expected to be set as

KerasRegistry

Metaclass for defining Abstract Base Classes (ABCs).

MetricRegistry

Meta class to register SimpleML persistables. expected to be set as

ModelRegistry

Meta class to register SimpleML persistables. expected to be set as

NamedRegistry

Explicitly named version of the registry (not implicit on class names)

PersistableRegistry

Meta class to register SimpleML persistables. expected to be set as

PipelineRegistry

Meta class to register SimpleML persistables. expected to be set as

Registry

Importable class to maintain reference to the global registry

Attributes

DATASET_REGISTRY

FILEPATH_REGISTRY

KERAS_REGISTRY

LOAD_METHOD_REGISTRY

METRIC_REGISTRY

MODEL_REGISTRY

ORM_REGISTRY

PIPELINE_REGISTRY

SAVE_METHOD_REGISTRY

SIMPLEML_REGISTRY

__author__

simpleml.registries.DATASET_REGISTRY[source]
simpleml.registries.FILEPATH_REGISTRY[source]
simpleml.registries.KERAS_REGISTRY[source]
simpleml.registries.LOAD_METHOD_REGISTRY[source]
simpleml.registries.METRIC_REGISTRY[source]
simpleml.registries.MODEL_REGISTRY[source]
simpleml.registries.ORM_REGISTRY[source]
simpleml.registries.PIPELINE_REGISTRY[source]
simpleml.registries.SAVE_METHOD_REGISTRY[source]
simpleml.registries.SIMPLEML_REGISTRY[source]
simpleml.registries.__author__ = Elisha Yadgaran[source]
class simpleml.registries.DatasetRegistry[source]

Bases: PersistableRegistry

Meta class to register SimpleML persistables. expected to be set as metaclass for all persistable types

Metaclass implementation. Called on import of referenced subclasses (not called on construction of classes)

class simpleml.registries.KerasRegistry[source]

Bases: abc.ABCMeta

Metaclass for defining Abstract Base Classes (ABCs).

Use this metaclass to create an ABC. An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as ‘virtual subclasses’ – these and their descendants will be considered subclasses of the registering ABC by the built-in issubclass() function, but the registering ABC won’t show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via super()).

class simpleml.registries.MetricRegistry[source]

Bases: PersistableRegistry

Meta class to register SimpleML persistables. expected to be set as metaclass for all persistable types

Metaclass implementation. Called on import of referenced subclasses (not called on construction of classes)

class simpleml.registries.ModelRegistry[source]

Bases: PersistableRegistry

Meta class to register SimpleML persistables. expected to be set as metaclass for all persistable types

Metaclass implementation. Called on import of referenced subclasses (not called on construction of classes)

class simpleml.registries.NamedRegistry[source]

Bases: Registry

Explicitly named version of the registry (not implicit on class names)

context_register(self, name, cls)

Context manager to temporarily overwrite registry value Reverts to original value on exit

usage: ``` with NamedRegistry(…).context_register(name, cls):

```

Parameters
  • name (str) –

  • cls (Type) –

Return type

None

register(self, name, cls, allow_duplicates=True)
Parameters
  • name (str) –

  • cls (Type) –

  • allow_duplicates (bool) –

Return type

None

class simpleml.registries.PersistableRegistry[source]

Bases: abc.ABCMeta

Meta class to register SimpleML persistables. expected to be set as metaclass for all persistable types

Metaclass implementation. Called on import of referenced subclasses (not called on construction of classes)

__call__(self, *args, **kwargs)

Overwrite constructor call to add post init hook (called when constructing referenced subclasses)

class simpleml.registries.PipelineRegistry[source]

Bases: PersistableRegistry

Meta class to register SimpleML persistables. expected to be set as metaclass for all persistable types

Metaclass implementation. Called on import of referenced subclasses (not called on construction of classes)

class simpleml.registries.Registry[source]

Bases: object

Importable class to maintain reference to the global registry

clear(self)

Clear registry

Return type

None

context_register(self, cls)

Context manager to temporarily overwrite registry value Reverts to original value on exit

usage: ``` with Registry(…).context_register(cls):

```

Parameters

cls (Type) –

Return type

None

drop(self, key)

Drop key from registry

Parameters

key (str) –

Return type

None

get(self, class_name)
Parameters

class_name (str) –

Return type

Type

get_from_registry(self, class_name)
Parameters

class_name (str) –

Return type

Optional[Type]

register(self, cls)
Parameters

cls (Type) –

Return type

None