Register#

navground.learning.register

Bases: object

Internal helper class that can be converted to/from a plain dictionary

Sub-classes can override this method to provide fields in asdict.

The default implementation returns an empty dict.

Returns:

A YAML-able dictionary

Return type:

dict[str, Any]

Sub-classes can override this method to load an instance from a dictionary.

The default implementation initializes the class with no arguments.

Parameters:

value (Mapping[str, Any]) – The value

Returns:

An instance initialized from the content of value.

Return type:

Self

Load an instance from a dictionary.

Selects a class from field type and calls its method _make_from_dict().

Parameters:

value (Mapping[str, Any]) – The value

Raises:

ValueError – If type is not defined or not registered.

Returns:

An instance initialized from the content of value.

Return type:

Self

The YAML-able dictionary representation.

Adds the class type name to the dictionary returned by _get_dict().

Returns:

A YAML-able dictionary