gemseo / utils

Show inherited members

singleton module

Singletons implementation and variants.

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

instances = {(93876613269696, 139640022552736): <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

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