neofoam.framework.dependency_resolver¶
Runtime dependency resolution for Depends() markers.
Handles dependency injection during solver/model execution.
- class neofoam.framework.dependency_resolver.DependencyResolver[source]¶
Bases:
objectResolve Depends() markers and context-backed arguments.
- neofoam.framework.dependency_resolver.wrap_with_dependency_resolution(func: Callable[[...], Any], instance: Any, dependency_resolver: DependencyResolver) Callable[[Context], Any][source]¶
Wrap func so it can be called with just a Context.
Dependencies are resolved via dependency_resolver. If the function signature includes a
selfparameter it is bound to instance. If the return value is aFieldUpdatesthe context is updated automatically.This is the canonical implementation shared by
SolverSpecandModelSpec— avoids duplicating the same wrapper in every factory.