Skip to content

registry operations

Bases: Generic[TComponent]

Shared registry operations inherited by analysis component managers.

Algorithm, constraint-handler, system, test, and integrator managers expose these operations through their model.analysis namespaces. This implementation is not constructed directly in ordinary scripts. Each instance has its own tag space; factory type maps are supplied by the concrete component family.

Methods:

Name Description
add

Register an object of this manager's component family and assign its tag.

create

Construct and register a component using its family factory key.

get

Look up a current integer-convertible component tag, returning None if absent.

get_all

Return a shallow registry snapshot with original component objects.

remove

Detach one component and compact surviving registry tags.

clear

Detach all family components and clear their assigned tags.

set_tag_start

Set the positive component-tag origin and retag current objects.

get_available_types

Return current class-wide constructor keys for this component family.

Methods:

add

add(component: TComponent) -> TComponent

Register an object of this manager's component family and assign its tag.

Parameters:

Name Type Description Default
component TComponent

Unmanaged object or one already owned here.

required

Returns:

Name Type Description
component TComponent

Original object, retained by this manager.

Raises:

Type Description
TypeError

Object is not of the expected component family.

ValueError

Ownership or registry-tag conflict.

create

create(component_type: str, **kwargs: Any) -> TComponent

Construct and register a component using its family factory key.

Parameters:

Name Type Description Default
component_type str

Case-insensitive registry type name.

required
**kwargs Any

Arguments passed to the registered constructor.

{}

Returns:

Name Type Description
component TComponent

New registered definition.

Raises:

Type Description
ValueError

Type name is unknown or component/registration validation fails.

TypeError

Constructor arguments are unsupported.

get

get(tag: int) -> Optional[TComponent]

Look up a current integer-convertible component tag, returning None if absent.

Parameters:

Name Type Description Default
tag int

Local component registry key, not a model node/cell tag.

required

get_all

get_all() -> Dict[int, TComponent]

Return a shallow registry snapshot with original component objects.

remove

remove(tag: int) -> None

Detach one component and compact surviving registry tags.

Parameters:

Name Type Description Default
tag int

Current tag; absent entries are ignored.

required

Analyses retaining the detached object are not repaired or removed. Registry edits do not reconfigure an already running solver.

clear

clear() -> None

Detach all family components and clear their assigned tags.

The class-wide constructor map is retained. Existing Analysis objects can still hold references to detached components.

set_tag_start

set_tag_start(start_tag: int) -> None

Set the positive component-tag origin and retag current objects.

Parameters:

Name Type Description Default
start_tag int

Origin validated by the tagging policy.

required

Raises:

Type Description
ValueError

Invalid origin. Cached integer references may become stale.

get_available_types

get_available_types() -> list[str]

Return current class-wide constructor keys for this component family.

These are type names accepted by create(), not the tags of registered instances or a probe of features compiled into the installed solver.