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 = {(94414693362464, 140446868614448): <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 = {(94414699991760, '/home/docs/checkouts/readthedocs.org/user_builds/gemseo/checkouts/4.3.0.post0/doc_src/_examples/cache/my_cache.hdf5'): <gemseo.caches.hdf5_file_singleton.HDF5FileSingleton object>}