neofoam.framework.solver.runtime

SolverRuntime — mutable per-instance state for a SolverSpec.

Created by SolverSpec.instantiate(). Each call produces an independent runtime so multiple solver runs never share mutable state.

class neofoam.framework.solver.runtime.SolverRuntime(spec: SolverSpec, name: str, argv: list[Any] = <factory>, state: SolverState = <factory>, _config_instance: Any = None)[source]

Bases: object

One instantiation of a SolverSpec with its own mutable state.

Owns per-instance state (models, configs, argv). All decorator- registered callables live on the spec; this object provides the public execution API (initialize, execution_graph, operations).

property configs: dict[str, Any]

Access configs from state.

property core_models: list[Any]

Access core_models from state.

execution_graph(domain_name: str | None = None) tuple['StepBuilder', 'OperationCollection'][source]

Execute the registered execution graph step.

get_config() Any[source]

Get solver configuration instance (lazy initialization).

Used as a dependency provider:

config: Annotated[MyConfig, Depends(solver.get_config)]

initialize() Context[source]

Execute the registered initialization step.

property operations: OperationCollection

Build operations with this runtime as the self binding.

property optional_models: list[Any]

Access optional_models from state.

class neofoam.framework.solver.runtime.SolverState(core_models: list[Any] = <factory>, optional_models: list[Any] = <factory>, configs: dict[str, ~typing.Any]=<factory>)[source]

Bases: object

Mutable state container for a single solver run.