neofoam.framework.model.runtime

ModelRuntime — one instantiation of a ModelSpec with its own loaded config.

Created by ModelSpec.instantiate(). Never shared between solver runs.

class neofoam.framework.model.runtime.ModelRuntime(spec: ModelSpec, name: str, config: Any)[source]

Bases: object

One instantiation of a ModelSpec with its own loaded config.

Owns per-instance state (config, name). All stage execution delegates to the spec, passing config explicitly so state never leaks between runs.

property configs: list[Any]

Return BaseConfig instances held by this runtime.

Used by LoadResult.configs to collect configs for validation. Handles both a single config and a SimpleNamespace of multiple configs.

property operations: list['Operation']

Build operations with this runtime as the self binding.

run_build() list['InitStep'][source]

Call spec’s build func with this instance’s config (if it accepts args).

run_resolve(ctx: ConfigContext) None[source]

Call spec’s resolve func; store the returned updated config.