Repository navigation
Clarify observed save_idxs rejection (DE #1036) - #1467
Merged
ChrisRackauckas merged 1 commit intoJul 24, 2026
Merged
ChrisRackauckas merged 1 commit into
ChrisRackauckas merged 1 commit into
Conversation
Observed symbols in save_idxs were already rejected, but with a generic "variables and timeseries parameters" message that did not distinguish observed quantities from other invalid symbols. Detect is_observed and raise a dedicated ArgumentError with workarounds and a pointer to DifferentialEquations.jl#1036. Document the limitation on the symbolic save_idxs and common-keywords pages. Add unit and MTK downstream tests. Full observed save_idxs support is intentionally not implemented: solver save paths are integer u[idxs] indexing, and eval-at-save observed columns need SavedSubsystem + OrdinaryDiffEqCore design work beyond a small PR. Co-Authored-By: Chris Rackauckas <[email protected]>
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.
This PR should be ignored until reviewed by @ChrisRackauckas.
Related: SciML/DifferentialEquations.jl#1036 (observed variables in
save_idxs).What this is (and is not)
This is the smallest correct slice for DE #1036: a dedicated error + docs when observed symbols appear in
save_idxs. It does not implement observed save columns.Full support is intentionally out of scope for this PR. Solver save paths (e.g. OrdinaryDiffEqCore) hard-code
u[save_idxs]integer indexing. Eval-at-save observed storage needs a multi-package design (SavedSubsystemobserved map + save-path evaluation + interpolation policy). Silently expanding observed to full-state save would look like support but would not meet the memory goal and would be a wrong answer.Change
When
is_observed(indp, var)holds for a rejectedsave_idxsentry, throw:Generic non-state / non-timeseries-parameter rejection is unchanged.
Docs updated:
docs/src/interfaces/Symbolic_SaveIdxs.md— explicit observed limitationdocs/src/interfaces/Common_Keywords.md—save_idxskeyword noteTests (run locally)
Unit (
SymbolCacheExpr as observed):Downstream MTK + regression:
Including: observed-only and mixed
[x, obs]rejection, full-solvesol[obs]still works, symbolic statesave_idxsstill works, all-states symbolic translation regression from #1460 still works.Follow-up design (not in this PR)
SavedSubsystemwithobserved_map(saved column → observed symbolic + callable).saveat/ non-dense for observed-only; refuse dense interp unless parent states also saved.