neofoam.framework.initialization.execution.context_builder¶
Route InitResult values into a Context.
The routing layer is open for extension: register additional category
handlers via CategoryRouter.register. Unknown categories fall
through to models with a logged warning.
- class neofoam.framework.initialization.execution.context_builder.CategoryRouter[source]¶
Bases:
objectRegistry mapping
InitResult.categoryto handlers.
- class neofoam.framework.initialization.execution.context_builder.ContextBuilder(fields: dict[str, ~typing.Any]=<factory>, models: dict[str, ~typing.Any]=<factory>, mesh: Any = None, runtime: Any = None)[source]¶
Bases:
objectMutable accumulator routed values are written into.
Calling
to_context()produces the immutableContext.
- neofoam.framework.initialization.execution.context_builder.build_context_from_results(init_results: list[InitResult], *, router: CategoryRouter | None = None) Context[source]¶
Build a
Contextby routinginit_resultsthroughrouter.
- neofoam.framework.initialization.execution.context_builder.default_router() CategoryRouter[source]¶
Router populated with the four built-in category handlers.