Abstract factory to create drivers.
- class gemseo.algos.base_algo_factory.BaseAlgoFactory(use_cache=False)¶
A base class for creating factories for objects of kind
This factory can create objects from a base class or any of its subclasses that can be imported from the given module sources. The base class and the module sources shall be defined as class attributes of the factory class, for instance:
- class AFactory(BaseAlgoFactory):
_CLASS = ABaseClass _MODULE_NAMES = (“first.module.fully.qualified.name”,
A factory instance can use a cache for the objects it creates, this cache is only used by one factory instance and is not shared with another instance. The cache is activated by passing
use_cache = Trueto the constructor. When the cache is activated, a factory will return an object already created when possible and will create a new object otherwise.
use_cache (bool) –
Whether to cache the created objects.
By default it is set to False.
Clear the library cache.
- Return type:
Create a driver library from an algorithm name.
- execute(problem, algo_name, **options)¶
Execute a problem with an algorithm.
Return a class from its name.
Return the name of the library related to the name of a class.
Check the availability of a library name or algorithm name.
- property algo_names_to_libraries: dict[str, str]¶
The mapping from the algorithm names to the libraries.