Skip to content

Propagate interp/dense to DiffEqArrays from solution callables#1297

Merged
ChrisRackauckas merged 1 commit into
SciML:v3from
ChrisRackauckas-Claude:cr/delegate-diffeqarray-interp
Apr 1, 2026
Merged

Propagate interp/dense to DiffEqArrays from solution callables#1297
ChrisRackauckas merged 1 commit into
SciML:v3from
ChrisRackauckas-Claude:cr/delegate-diffeqarray-interp

Conversation

@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor

Summary

  • augment and all ODE solution callable methods now pass interp = sol.interp, dense = sol.dense when constructing DiffEqArray results
  • Returned DiffEqArray objects are themselves callable: sol([0.0, 1.0])(0.5) works
  • Adds plotting and callable interface documentation to Solutions.md, referencing RecursiveArrayTools as the canonical source for plot recipe docs
  • Bumps RecursiveArrayTools compat to 3.48, 4 (requires interp/dense fields on DiffEqArray)

Context

RecursiveArrayTools v3.48+ / v4 adds interp and dense fields to DiffEqArray with a callable interface da(t) and a plot recipe that supports dense interpolation. This is the complementary SciMLBase PR that propagates interpolation data from ODE solutions into the DiffEqArray objects they return, so downstream consumers get callable, plottable arrays.

Test plan

  • SciMLBase core tests pass (Pkg.test() with GROUP=Core)
  • Smoke test: DiffEqArray with LinearInterpolation callable works
  • Smoke test: sol([0,1])(0.5) chained interpolation works

🤖 Generated with Claude Code

@ChrisRackauckas-Claude
Copy link
Copy Markdown
Contributor Author

Updated — now delegates full plotting to RecursiveArrayTools v4

Plotting delegation

  • Moves interpret_vars, diffeq_to_arrays, solplot_vecs_and_labels, add_labels!, DEFAULT_PLOT_FUNC, plottable_indices, plot_indices, getindepsym_defaultt to RecursiveArrayTools v4
  • The AbstractDiffEqArray recipe in RAT now handles the full plotting pipeline (variable selection, phase plots, dense interpolation, automatic labels)
  • The AbstractTimeseriesSolution recipe becomes a thin wrapper that computes solution-specific defaults, separates discrete vs continuous variables, and delegates continuous plotting to RAT's helpers
  • Net ~240 lines removed from solution_interface.jl

Interpolation propagation

  • augment and all ODE solution callable methods pass interp/dense to returned DiffEqArrays
  • Returned DiffEqArrays are themselves callable: sol([0.0, 1.0])(0.5) works

Compat

  • RecursiveArrayTools bumped to 4 (was 3.48, 4)

Depends on SciML/RecursiveArrayTools.jl#547 (RecursiveArrayTools v4.0)

ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/RecursiveArrayTools.jl that referenced this pull request Mar 30, 2026
SciMLBase can't resolve against RAT v4 until the companion SciMLBase PR
(SciML/SciMLBase.jl#1297) is merged. Move it out of the main test deps
into the downstream test Project.toml.

- Remove SciMLBase from [extras] and [targets] in Project.toml
- Add SciMLBase and ForwardDiff to test/downstream/Project.toml
- Move adjoints.jl to test/downstream/ (uses ODEProblem from SciMLBase)
- Core tests now pass without SciMLBase dependency

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/RecursiveArrayTools.jl that referenced this pull request Mar 30, 2026
- docs/Project.toml: bump RecursiveArrayTools compat from "3" to "4"
- test/jet_tests.jl: filter RecipesBase is_key_supported false positive
  (user recipe keywords like denseplot are dynamic, JET can't verify them)
- test/adjoints.jl: remove loss6/ODEProblem (needs SciMLBase) from Core,
  keep in test/downstream/adjoints.jl (disabled until SciMLBase compat bump)
- test/downstream/Project.toml: revert SciMLBase/ForwardDiff additions
  (can't resolve until SciML/SciMLBase.jl#1297 merges)

Pre-existing failures NOT from our changes:
- LTS @inferred sum(VA[VA[zeros(4,4)]]) — inference regression from
  AbstractArray subtyping, present since initial PR commits
- GPU CuArray ambiguity — from AbstractVectorOfArray <: AbstractArray
- Downstream SciMLBase resolution — expected until SciMLBase bumps compat

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ChrisRackauckas-Claude ChrisRackauckas-Claude force-pushed the cr/delegate-diffeqarray-interp branch from 21c1535 to 21699e3 Compare April 1, 2026 10:44
@ChrisRackauckas-Claude ChrisRackauckas-Claude changed the base branch from master to v3 April 1, 2026 10:46
@ChrisRackauckas-Claude ChrisRackauckas-Claude force-pushed the cr/delegate-diffeqarray-interp branch from 21699e3 to c8c2bc6 Compare April 1, 2026 10:55
DiffEqArray in RecursiveArrayTools v3.48+ has `interp` and `dense` fields
plus a callable interface `da(t)`. This PR propagates interpolation data
from ODE solutions to the DiffEqArrays they return, so that:

- `augment` passes `interp`/`dense` from the solution
- All callable methods that return `DiffEqArray(A.u, A.t, p, sol)` now
  also pass `interp = sol.interp, dense = sol.dense`
- Returned DiffEqArrays are themselves callable: `sol([0,1])(0.5)` works

Also adds plotting and callable interface docs to Solutions.md, referencing
RecursiveArrayTools as the canonical source for plot recipe documentation.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ChrisRackauckas-Claude ChrisRackauckas-Claude force-pushed the cr/delegate-diffeqarray-interp branch from c8c2bc6 to d8a335d Compare April 1, 2026 10:57
@ChrisRackauckas ChrisRackauckas merged commit 6f2af8e into SciML:v3 Apr 1, 2026
44 of 46 checks passed
@ChrisRackauckas ChrisRackauckas mentioned this pull request Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants