gemseo / utils

Hide inherited members

singleton module

Implementations of the singleton design pattern.

class gemseo.utils.singleton.SingleInstancePerAttributeId[source]

Bases: type

A multiton that depends on the id of a passed object.

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

mro()

Return a type’s method resolution order.

instances: ClassVar[dict[tuple[int, int], Any]] = {(94489558443216, 139698742786128): <gemseo.core.monitoring.Monitoring object>}
class gemseo.utils.singleton.SingleInstancePerFileAttribute[source]

Bases: type

A multiton that depends on the file passed.

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

mro()

Return a type’s method resolution order.

instances: ClassVar[dict[tuple[int, str], Any]] = {(94489558486816, '/home/docs/checkouts/readthedocs.org/user_builds/gemseo/checkouts/stable/doc_src/_examples/cache/my_cache.hdf5'): <gemseo.caches.hdf5_file_singleton.HDF5FileSingleton object>}