Reference
Registry¶
Runtime registry of system classes. Every concrete subclass of a family base auto-registers at class-definition time — the 149 built-ins and your own classes alike. The registry is what the bulk test suite and the documentation generator iterate over.
from tsdynamics import registry
registry.families() # {'ode': 118, 'dde': 5, 'map': 26}
registry.categories(family="map") # {'chaotic_maps': 9, ...}
entry = registry.get("Lorenz") # SystemEntry
entry.cls, entry.family, entry.category # (<class Lorenz>, 'ode', 'chaotic_attractors')
registry
¶
Runtime registry of dynamical-system classes.
Every concrete subclass of :class:~tsdynamics.families.base.SystemBase is
registered automatically at class-definition time (via
SystemBase.__init_subclass__) — built-in systems and user-defined ones
alike. Built-in systems (those defined under tsdynamics.systems) are
what the bulk test-suite and the documentation generator iterate over;
user-defined classes are registered too but excluded from iteration by
default.
Alongside the system registry, this module hosts two reserved generic name
registries — :data:analyses and :data:transforms — :class:Registry
containers (name → object + metadata) for the analysis and transform streams to
register into. Solvers are not registered here: they live in the richer
:mod:tsdynamics.solvers registry (a name → SolverSpec table carrying
capability flags, populated by that package's directory scan + the
:mod:~tsdynamics.plugins entry-point loader).
This module must stay import-light: it is imported while the tsdynamics
package itself is still initialising, so it may only depend on the standard
library.
Examples:
>>> from tsdynamics import registry
>>> registry.families()
{'ode': 118, 'dde': 5, 'map': 26}
>>> lorenz = registry.get("Lorenz")
>>> lorenz.family, lorenz.category
('ode', 'chaotic_attractors')
>>> [e.name for e in registry.all_systems(family="dde")]
['MackeyGlass', 'IkedaDelay', 'SprottDelay', 'ScrollDelay', 'PiecewiseCircuit']
SystemEntry
dataclass
¶
SystemEntry(
name: str,
cls: type,
family: Family,
category: str,
module: str,
dim: int | None,
params: Mapping[str, Any],
is_builtin: bool,
reference: str | None = None,
known_lyapunov: Mapping[str, Any] | None = None,
)
One registered system class plus the metadata the tooling needs.
RegistryEntry
dataclass
¶
One named, registered object plus its metadata.
Registry
¶
Registry(kind: str)
A minimal, generic name → object registry.
Backs the :data:analyses and :data:transforms registries. It only
stores and looks up; the discovery that fills it (directory scans,
:mod:~tsdynamics.plugins entry points) is built on top of it elsewhere.
Registration is usable directly or as a decorator::
analyses.register("lyapunov", lyapunov_spectrum) # direct
@analyses.register("corr_dim", needs="trajectory") # decorator
def correlation_dimension(traj): ...
Re-registering the same object under a name is idempotent (safe across
module re-imports). A clash between two different objects on one name
raises unless replace=True.
Source code in src/tsdynamics/registry.py
register
¶
Register obj under name.
Called with obj it registers and returns it; called without it
returns a decorator (so it can wrap a class/function definition).
Extra keyword arguments are stored as the entry's metadata.
Source code in src/tsdynamics/registry.py
get
¶
Return the object registered under name (raises KeyError with hints).
Source code in src/tsdynamics/registry.py
entry
¶
entry(name: str) -> RegistryEntry
Return the full :class:RegistryEntry (object + metadata) for name.
Source code in src/tsdynamics/registry.py
names
¶
all
¶
all() -> list[RegistryEntry]
register_class
¶
register_class(cls: type) -> None
Register a system class. Called from SystemBase.__init_subclass__.
Classes without a concrete _equations/_step (abstract intermediate
bases) are ignored. Two built-in classes sharing a name is a bug and
raises immediately; user classes may freely shadow builtin names.
Source code in src/tsdynamics/registry.py
all_systems
¶
all_systems(
*,
family: str | None = None,
category: str | None = None,
builtin: bool | None = True,
) -> list[SystemEntry]
Return registered systems, in registration (= import) order.
| PARAMETER | DESCRIPTION |
|---|---|
family
|
Keep only one family.
TYPE:
|
category
|
Keep only one category (module stem, e.g.
TYPE:
|
builtin
|
TYPE:
|
Source code in src/tsdynamics/registry.py
by_family
¶
by_family(family: str, **kwargs: Any) -> list[SystemEntry]
get
¶
get(name: str, *, builtin: bool = True) -> SystemEntry
Look up a single system by class name.
Prefers the built-in entry when builtin is True (the default);
raises KeyError with name suggestions otherwise.
Source code in src/tsdynamics/registry.py
families
¶
Return {family: count} for the registered systems.
Source code in src/tsdynamics/registry.py
categories
¶
Return {category: count}, optionally restricted to one family.