evolver.calibration.interface.Transformer

class evolver.calibration.interface.Transformer(*args, name: str = None, auto_config=True, auto_config_ignore_fields=None, **kwargs)[source]

Base Interface class for implementing transformations.

A modular layer for encapsulating the transformation and conversion methods between, e.g., raw and un-raw values, or conversion between units etc. This can also be used for such transformations as needed for transforming between uncalibrated and calibrated values.

__init__(*args, name: str = None, auto_config=True, auto_config_ignore_fields=None, **kwargs)

Methods

__init__(*args[, name, auto_config, ...])

auto_assign_attrs_from_config(kwargs[, ...])

Auto instance attribute assignment functionality via cls.Config introspection.

convert_from(*args, **kwargs)

Implement and return some transformation upon the input.

convert_to(*args, **kwargs)

Implement and return some transformation upon the input.

create([config])

Create an instance from a config.

fit(*args, **kwargs)

Override to implement a fitting function responsible for returning a Config instance that can then be used for convert_to and convert_from.

init_descriptors(**non_config_kwargs)

Automatically walk over all vars and instantiate any that are ConfigDescriptors.

post_init_vars(*args, **kwargs)

A hook to override and perform additional initialization after instance attrs are assigned but before any ConfigDescriptor are converted to classinfo objects.

refit(*args, **kwargs)

Attributes

classinfo

Return the class' fully qualified name.

config

Return a dict of Config populated from instance attributes.

config_json

Return a JSON str from a Config populated from instance attributes.

config_model

Return an instance of Config populated from instance attributes.

descriptor

Return a ConfigDescriptor.

status

Override to return an instance of Status indicating whether the associated transformation config parameters are OK to use or should be considered stale and recalibrated.