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: object

Registry mapping InitResult.category to 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: object

Mutable accumulator routed values are written into.

Calling to_context() produces the immutable Context.

neofoam.framework.initialization.execution.context_builder.build_context_from_results(init_results: list[InitResult], *, router: CategoryRouter | None = None) Context[source]

Build a Context by routing init_results through router.

neofoam.framework.initialization.execution.context_builder.default_router() CategoryRouter[source]

Router populated with the four built-in category handlers.