gemseo / utils

singleton module

Singletons implementation and variants

Classes:

SingleInstancePerAttributeEq

A Singleton-like design pattern so that subclasses are only instantiated when the discipline instance passed as input of the constructor is different from already created instances.

SingleInstancePerAttributeId

A Singleton-like design pattern so that subclasses are only instantiated when the discipline instance passed as input of the constructor is different from already created instances.

SingleInstancePerFileAttribute

A Singleton-like design pattern so that subclasses are only instantiated when the discipline instance passed as input of the constructor is different from already created instances.

class gemseo.utils.singleton.SingleInstancePerAttributeEq[source]

Bases: type

A Singleton-like design pattern so that subclasses are only instantiated when the discipline instance passed as input of the constructor is different from already created instances.

The test if the instances are equal is made with the obj1 == obj2 operator

Attributes:

instances

Methods:

mro()

Return a type’s method resolution order.

instances = {}
mro()

Return a type’s method resolution order.

class gemseo.utils.singleton.SingleInstancePerAttributeId[source]

Bases: type

A Singleton-like design pattern so that subclasses are only instantiated when the discipline instance passed as input of the constructor is different from already created instances.

The test if the instances are equal is made with the id(obj1)==id(obj2) operator

Attributes:

instances

Methods:

mro()

Return a type’s method resolution order.

instances = {(94770883284592, 140057406514704): <gemseo.core.monitoring.Monitoring object>}
mro()

Return a type’s method resolution order.

class gemseo.utils.singleton.SingleInstancePerFileAttribute[source]

Bases: type

A Singleton-like design pattern so that subclasses are only instantiated when the discipline instance passed as input of the constructor is different from already created instances.

The test if the instances are equal is made with the obj1 == obj2 operator

Attributes:

instances

Methods:

mro()

Return a type’s method resolution order.

instances = {(94770894438096, '/home/docs/checkouts/readthedocs.org/user_builds/gemseo/checkouts/3.1.0/doc_src/examples/cache/my_cache.hdf5'): <gemseo.caches.hdf5_cache.HDF5FileSingleton object>}
mro()

Return a type’s method resolution order.