leaspy.io.data.factory ====================== .. py:module:: leaspy.io.data.factory .. autoapi-nested-parse:: Defines the noise model factory. .. !! processed by numpydoc !! Attributes ---------- .. autoapisummary:: leaspy.io.data.factory.DataframeDataReaderFactoryInput Classes ------- .. autoapisummary:: leaspy.io.data.factory.DataframeDataReaderNames Functions --------- .. autoapisummary:: leaspy.io.data.factory.dataframe_data_reader_factory Module Contents --------------- .. py:class:: DataframeDataReaderNames(*args, **kwds) Bases: :py:obj:`enum.Enum` Enumeration defining the possible names for observation models. .. !! processed by numpydoc !! .. py:attribute:: EVENT :value: 'event' .. py:attribute:: VISIT :value: 'visit' .. py:attribute:: JOINT :value: 'joint' .. py:attribute:: COVARIATE :value: 'covariate' .. py:method:: from_string(reader_name) :classmethod: Returns the enum member corresponding to the given string. :Parameters: **reader_name** : :obj:`str` The name of the reader, case-insensitive. :Returns: :class:`~leaspy.io.data.factory.DataframeDataReaderNames` The corresponding enum member. :Raises: :exc:`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. .. !! processed by numpydoc !! .. py:data:: DataframeDataReaderFactoryInput .. py:function:: dataframe_data_reader_factory(reader, **kwargs) Factory for observation models. :Parameters: **model** : :obj:`str` or :class:`~leaspy.models.obs_models` or :obj:`dict` [ :obj:`str`, ...] - If :class:`~leaspy.models.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: :class:`~leaspy.io.data.abstract_dataframe_data_reader.AbstractDataframeDataReader` The desired observation model. :Raises: :exc:`.LeaspyModelInputError` If `model` is not supported. .. !! processed by numpydoc !!