mlrl.testbed.experiments.input.sources.source module

Author Michael Rapp (michael.rapp.ml@gmail.com)

Provides classes for implementing sources, input data may be read from.

class mlrl.testbed.experiments.input.sources.source.DatasetFileSource(directory: Path, suffix: str)

Bases: FileSource, ABC

An abstract base class for all classes that allow to read a dataset from a file.

class mlrl.testbed.experiments.input.sources.source.FileSource(directory: Path, suffix: str)

Bases: Source, ABC

An abstract base class for all sources that read input data from a file.

is_available(state: ExperimentState, input_data: InputData) bool

Must be implemented by subclasses in order to check whether input data is available or not.

Parameters:
  • state – The state that should be used to store the input data

  • input_data – The input data that should be read

Returns:

True, if the input data is available, False otherwise

read_from_source(state: ExperimentState, input_data: InputData) bool

Must be implemented by subclasses in order to read input data from the source.

Parameters:
  • state – The state that should be used to store the input data

  • input_data – The input data that should be read

Returns:

True, if any input data has been read, False otherwise

class mlrl.testbed.experiments.input.sources.source.Source

Bases: ABC

An abstract base class for all sources, input data may be read from.

abstractmethod is_available(state: ExperimentState, input_data: InputData) bool

Must be implemented by subclasses in order to check whether input data is available or not.

Parameters:
  • state – The state that should be used to store the input data

  • input_data – The input data that should be read

Returns:

True, if the input data is available, False otherwise

abstractmethod read_from_source(state: ExperimentState, input_data: InputData) bool

Must be implemented by subclasses in order to read input data from the source.

Parameters:
  • state – The state that should be used to store the input data

  • input_data – The input data that should be read

Returns:

True, if any input data has been read, False otherwise

class mlrl.testbed.experiments.input.sources.source.StructuralFileSource(directory: Path, suffix: str)

Bases: FileSource, ABC

An abstract base class for all classes that allow to read structural input data from a file.

class mlrl.testbed.experiments.input.sources.source.TabularFileSource(directory: Path, suffix: str)

Bases: FileSource, ABC

An abstract base class for all classes that allow to read tabular input data from a file.

class mlrl.testbed.experiments.input.sources.source.TextualFileSource(directory: Path, suffix: str)

Bases: FileSource, ABC

An abstract base class for all classes that allow to read textual input data from a file.