leaspy.io.data.factory

Defines the noise model factory.

Attributes

Classes

DataframeDataReaderNames

Enumeration defining the possible names for observation models.

Functions

dataframe_data_reader_factory(reader, **kwargs)

Factory for observation models.

Module Contents

class DataframeDataReaderNames(*args, **kwds)[source]

Bases: enum.Enum

Enumeration defining the possible names for observation models.

EVENT = 'event'
VISIT = 'visit'
JOINT = 'joint'
COVARIATE = 'covariate'
classmethod from_string(reader_name)[source]

Returns the enum member corresponding to the given string.

Parameters:
reader_namestr

The name of the reader, case-insensitive.

Returns:
DataframeDataReaderNames

The corresponding enum member.

Raises:
NotImplementedError

If the provided reader_name does not match any of the enum members and is not implemented. Give the valid names in the error message.

Parameters:

reader_name (str)

DataframeDataReaderFactoryInput
dataframe_data_reader_factory(reader, **kwargs)[source]

Factory for observation models.

Parameters:
modelstr or obs_models or dict [ str, …]
  • If obs_models, returns the instance.

  • If a string, then returns a new instance of the appropriate class (with optional parameters kws).

  • If a dictionary, it must contain the ‘name’ key and other initialization parameters.

**kwargs

Optional parameters for initializing the requested observation model when a string.

Returns:
AbstractDataframeDataReader

The desired observation model.

Raises:
LeaspyModelInputError

If model is not supported.

Parameters:

reader (DataframeDataReaderFactoryInput)

Return type:

AbstractDataframeDataReader