gemseo / uncertainty / distributions

factory module

Distribution factory

This module contains a factory to instantiate a Distribution 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 distributions types and allows you to test if a distribution type is available.

class gemseo.uncertainty.distributions.factory.DistributionFactory[source]

Bases: object

This factory instantiates a Distribution 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 Distribution. Searches in “GEMSEO_PATH” and gemseo.uncertainty.p_dist.

create(distribution_name, variable, **parameters)[source]

Creates a distribution.

Parameters
  • distribution_name (str) – name of the distribution (its classname)

  • variable (str) – variable name.

  • parameters – distribution parameters

Returns

distribution_name distribution

property distributions

Lists the available classes.

Returns

the list of classes names.

Return type

list(str)

is_available(distribution_name)[source]

Checks the availability of a distribution.

Parameters

distribution_name (str) – name of the distribution.

Returns

True if the distribution is available.

Return type

bool