gemseo / utils

singleton module

Singletons implementation and variants.

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

mro()

Return a type’s method resolution order.

instances = {(93934633343872, 139850022966800): <gemseo.core.monitoring.Monitoring object>}
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

mro()

Return a type’s method resolution order.

instances = {(93934599319888, '/home/docs/checkouts/readthedocs.org/user_builds/gemseo/checkouts/develop/doc_src/_examples/cache/my_cache.hdf5'): <gemseo.caches.hdf5_file_singleton.HDF5FileSingleton object>}