gemseo / problems / dataset

factory module

Dataset factory

This module contains a factory to instantiate a Dataset from its class name. The class can be internal to GEMSEO or located in an external module whose path is provided to the constructor. It also provides a list of available cache types and allows you to test if a cache type is available.

Classes:

DatasetFactory()

This factory instantiates a Dataset from its class name.

class gemseo.problems.dataset.factory.DatasetFactory[source]

Bases: object

This factory instantiates a Dataset from its class name.

The class can be internal to GEMSEO or located in an external module whose path is provided to the constructor.

Initializes the factory: scans the directories to search for subclasses of Dataset.

Searches in “GEMSEO_PATH” and gemseo.mlearning.p_datasets

Methods:

create(dataset, **options)

Create a dataset.

is_available(dataset)

Checks the availability of a dataset.

Attributes:

datasets

Lists the available datasets.

create(dataset, **options)[source]

Create a dataset.

Parameters
  • dataset (str) – name of the dataset (its classname).

  • options – additional options specific

Returns

dataset

Return type

Dataset

property datasets

Lists the available datasets.

Returns

the list of datasets.

Return type

list(str)

is_available(dataset)[source]

Checks the availability of a dataset.

Parameters

dataset (str) – name of the dataset (its class name).

Returns

True if the dataset is available.

Return type

bool