QDpy
Loading...
Searching...
No Matches
qdpy.base.Factory Class Reference
Inheritance diagram for qdpy.base.Factory:

Public Member Functions

Any build (self, Mapping[str, Any] config, Mapping[str, Any] default_params={}, **Any kwargs)

Protected Member Functions

Optional[str] _get_name (self, Any obj, Optional[str] key, Mapping[str, Any] config)

Detailed Description

Resolve registered types and named objects in a configuration.

A mapping with a type entry describes an object. A string matching a
previously built object's name refers to that object. Lists and
count mappings can request copies of registered configurations,
with reinitialisation where supported. Plain settings mappings
pass through to the constructor.

Build dependencies before the objects that refer to them. Use the
same Factory for the containers and algorithms of one experiment.

Definition at line 616 of file base.py.

Member Function Documentation

◆ _get_name()

Optional[str] qdpy.base.Factory._get_name ( self,
Any obj,
Optional[str] key,
Mapping[str, Any] config )
protected
Check if `obj` possess a name, and return it.

Definition at line 634 of file base.py.

◆ build()

Any qdpy.base.Factory.build ( self,
Mapping[str, Any] config,
Mapping[str, Any] default_params = {},
**Any kwargs )
Build a registered object or the named objects in a configuration section.

:param config: Mapping containing a type or nested object definitions.
:param default_params: Defaults inherited by object definitions.
:param kwargs: Additional arguments forwarded to the top-level factory hook.
:returns: The constructed object or a list of objects from a section.

The builder transforms a deep copy of the supplied mapping. A known
top-level name can return a previously built object.

Definition at line 707 of file base.py.


The documentation for this class was generated from the following file: