nirs4all.pipeline.steps.router module
Controller router for selecting appropriate controllers.
- class nirs4all.pipeline.steps.router.ControllerRouter(verbose: bool = False)[source]
Bases:
objectRoutes parsed steps to appropriate controllers.
Uses registry pattern with controller priorities. Extensible - new controllers automatically discovered via registry.
- registry
Controller registry (from nirs4all.controllers.registry)
- verbose
If True, print debug information about controller matching
- route(parsed_step: ParsedStep, step: Any = None) BaseController[source]
Select the appropriate controller for a parsed step.
- Parameters:
parsed_step – Parsed step configuration
step – Original step (for backward compatibility with matches())
- Returns:
Instantiated controller instance
- Raises:
TypeError – If no matching controller found
- route_from_raw(step: Any, operator: Any = None, keyword: str = '') BaseController[source]
Route from raw step parameters (backward compatibility).
- Parameters:
step – Raw step configuration
operator – Optional operator instance
keyword – Optional keyword hint
- Returns:
Instantiated controller instance
- Raises:
TypeError – If no matching controller found