hydromodpy.solver.base.registry#

Single (process_type, solver_name) adapter class registry.

This module is the canonical merge of the historical registries that used to live in solver/compatibility (class-based) and simulation/adapters (instance-based). It now serves both consumers:

  • Adapter authors register their class here (or via the hydromodpy.solver entry-points group, see load_plugins()).

  • The simulation runner asks for an instance through get_solver_adapter(), which instantiates the registered class on demand. This matches the lifecycle intent of SolverAdapter (one adapter = one run) while preserving the lightweight semantics of a static catalog.

The module also tracks output extractors keyed on the same (process_type, solver_name) pair. Extractors parse raw solver outputs into the SimulationCatalog after a run completes.

Built-in adapters and extractors shipped in-tree are declared as dotted paths and imported lazily on first lookup. That keeps hydromodpy.simulation free of eager imports of hydromodpy.solver concrete backends at package-load time.

Functions

capabilities(process_type, solver_name)

Return the declared runtime capabilities for one adapter pair.

get(process_type, solver_name)

Return the adapter class registered for the given pair.

get_extractor(process_type, solver_name)

Return the extractor class for (process_type, solver_name).

get_extractor_instance(process_type, solver_name)

Return a freshly-instantiated extractor, or None when unknown.

get_solver_adapter(process_type, solver_name)

Return a freshly-instantiated adapter for (process_type, solver_name).

is_adapter(obj)

Return True when obj structurally conforms to SolverAdapter.

is_supported(process_type, solver_name)

Return True when the pair is declared in the adapter registry.

known_process_types()

Return the set of process types declared by any registered adapter.

list_extractor_pairs()

Return all (process_type, solver_name) pairs with a registered extractor.

list_pairs()

Return all known pairs, sorted for stable output.

load_extractor_plugins(*[, force])

Discover and register extractors declared via the hydromodpy.solver.extractor entry-points group.

load_plugins(*[, force])

Discover and register adapters declared via the hydromodpy.solver entry-points group.

pairs_for_process(process_type)

Yield all known pairs whose process type matches.

register(process_type, solver_name, ...[, ...])

Register an adapter class for a (process_type, solver_name) pair.

register_extractor(process_type, ...[, replace])

Register an extractor class for a (process_type, solver_name) pair.

required_bindings(process_type, solver_name)

Return the earlier capability requirements declared by one adapter.

unregister(process_type, solver_name)

Remove an adapter entry (primarily for tests).

unregister_extractor(process_type, solver_name)

Remove an extractor entry (primarily for tests).