Expose all CoreSolver methods, extend validate_system(), wire jacobian#51
Merged
jc-macdonald merged 5 commits intomainfrom Apr 9, 2026
Merged
Expose all CoreSolver methods, extend validate_system(), wire jacobian#51jc-macdonald merged 5 commits intomainfrom
validate_system(), wire jacobian#51jc-macdonald merged 5 commits intomainfrom
Conversation
- IMEX + missing operators → missing_operators (3 tests) - implicit/Rosenbrock + missing jacobian → missing_jacobian (4 parametrized) - implicit + jacobian provided → no warning (4 parametrized) - explicit methods → no extra issues - implicit-euler run with system jacobian verifies end-to-end wiring Refs #41, #44
- Add py.typed marker to provider package - Use StateChangeEnum.FLOW/DELTA instead of string literals - Use OpEngineEngineConfig() instead of raw dicts - Narrow type: ignore[assignment] → type: ignore[method-assign]
pearsonca
approved these changes
Apr 9, 2026
| state_change: StateChangeEnum | ||
| config: OpEngineEngineConfig = Field(default_factory=OpEngineEngineConfig) | ||
|
|
||
| _IMPLICIT_METHODS: frozenset[str] = frozenset( |
Member
There was a problem hiding this comment.
also partially matches elements in config.py - feels like these should perhaps be extracted as a marker type rather than tracked as strings
| method: Literal["euler", "heun", "imex-euler", "imex-heun-tr", "imex-trbdf2"] = ( | ||
| "heun" | ||
| ) | ||
| method: Literal[ |
TimothyWillard
approved these changes
Apr 9, 2026
Collaborator
TimothyWillard
left a comment
There was a problem hiding this comment.
Agree with @pearsonca
Address review feedback from @pearsonca: method names are now a proper StrEnum (SolverMethod) with is_imex/is_implicit properties, replacing string literals and the _IMPLICIT_METHODS frozenset. - Add SolverMethod(StrEnum) to config.py with all 9 methods - Add is_imex and is_implicit properties on enum - Move _IMPLICIT_METHODS frozenset to config.py module level - Remove _IMPLICIT_METHODS class variable from engine - Update all tests to use SolverMethod enum members - Drop type: ignore[arg-type] from parametrized tests
Collaborator
Author
|
Agreed — pushed d3884fe replacing the string literals with a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Widens the provider's method palette to all 9 CoreSolver solvers and adds early validation so incompatible engine/system pairings surface at construction time rather than mid-
run().Changes
MethodNameinconfig.pynow includesimplicit-euler,trapezoidal,bdf2, andros2alongside the existing 5.validate_system()extended — IMEX method without operators →missing_operators. Implicit/Rosenbrock method withoutsystem.option("jacobian")→missing_jacobian. Existingstate_changecheck preserved.run()retrieves the Jacobian callable fromsystem.option("jacobian")and passes it through toRunConfig.py.typedmarker added — Enables downstream mypy checking of the provider package.StateChangeEnumliterals,OpEngineEngineConfigconstructors, narrowedtype: ignorecomments. All 20 tests pass, ruff + mypy--strictclean.Related
validate_system()in flepimop2 provider #41system._stepperwith publicsystem.bind()API #50 (system.bind()migration)