Selectors registry
Register and instantiate selector implementations used by the package.
This module defines a registry of available selector components, including their public names, implementation classes, and default initialization arguments. It also provides a helper function for constructing selector instances by name with optional runtime argument overrides.
The registry allows selectors to be referenced declaratively from task configurations, CLI options, or other factory-based workflows.
SelectorRegistryEntry
dataclass
Store the specification required to instantiate a selector.
Instances of this dataclass define a registry entry for a selector, including its public name, the selector class to instantiate, and the default keyword arguments used during construction.
Source code in aatm\registries\selectors.py
name
instance-attribute
Unique registry name used to identify the selector.
selector_class
instance-attribute
Selector class or constructor used to create the selector instance.
kwargs
instance-attribute
Default keyword arguments passed when instantiating the selector.
load_selector(name, **kwargs)
Load and instantiate a selector from the registry.
This function looks up a selector specification by name, copies its default keyword arguments, applies any user-provided overrides, and returns a new selector instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Registry name of the selector to instantiate. |
required |
**kwargs
|
Any
|
Keyword arguments that override or extend the default constructor arguments stored in the registry entry. |
{}
|
Returns:
| Type | Description |
|---|---|
BaseSelector
|
A newly instantiated selector corresponding to the requested registry entry. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no selector with the given name exists in the registry. |
TypeError
|
If the provided arguments are invalid for the selector constructor. |