pymixef.plugins module

Typed, deterministic registries for PyMixEF extension points.

class pymixef.plugins.CovariancePlugin(*args, **kwargs)[source]

Bases: Protocol

Minimal covariance plugin contract.

covariance(parameters, **context)[source]

Construct a covariance matrix.

Parameters:
  • parameters (Any)

  • context (Any)

Return type:

Any

validate(matrix, **context)[source]

Validate a covariance matrix.

Parameters:
  • matrix (Any)

  • context (Any)

Return type:

Any

simulate(parameters, **context)[source]

Simulate a zero-mean draw.

Parameters:
  • parameters (Any)

  • context (Any)

Return type:

Any

class pymixef.plugins.EstimatorPlugin(*args, **kwargs)[source]

Bases: Protocol

Minimal estimator extension contract.

fit(model, data, **controls)[source]

Fit a compiled model.

Parameters:
  • model (Any)

  • data (Any)

  • controls (Any)

Return type:

Any

class pymixef.plugins.PluginInfo(name, implementation, version=None, source='runtime')[source]

Bases: object

Metadata retained for one registered implementation.

Parameters:
  • name (str)

  • implementation (Any)

  • version (str | None)

  • source (str)

name: str
implementation: Any
version: str | None
source: str
class pymixef.plugins.Registry(kind)[source]

Bases: Generic[T]

Thread-safe registry with normalized names and explicit replacement.

Parameters:

kind (str)

static normalize(name)[source]
Parameters:

name (str)

Return type:

str

register(name, implementation=None, *, replace=False, version=None, source='runtime')[source]

Register an implementation, directly or as a decorator.

Parameters:
  • name (str)

  • implementation (T | None)

  • replace (bool)

  • version (str | None)

  • source (str)

Return type:

T | Callable[[T], T]

unregister(name)[source]

Remove and return a runtime registration.

Parameters:

name (str)

Return type:

T

get(name)[source]

Resolve an implementation by normalized name.

Parameters:

name (str)

Return type:

T

info(name)[source]

Return immutable registration metadata.

Parameters:

name (str)

Return type:

PluginInfo

names()[source]

Return deterministic registered names.

Return type:

tuple[str, …]

snapshot()[source]

Return a detached, sorted registry snapshot.

Return type:

Mapping[str, PluginInfo]

pymixef.plugins.discover_plugins(group='pymixef.plugins')[source]

Load package entry points in deterministic name order.

An entry point may be a zero-argument registration function or an import whose module-level code performs registration.

Parameters:

group (str)

Return type:

tuple[str, …]