Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.45 broke plotting with idxs as a tuple with a function #746

Closed
ranocha opened this issue Jul 24, 2024 · 3 comments · Fixed by #750
Closed

v2.45 broke plotting with idxs as a tuple with a function #746

ranocha opened this issue Jul 24, 2024 · 3 comments · Fixed by #750
Assignees
Labels
bug Something isn't working

Comments

@ranocha
Copy link
Member

ranocha commented Jul 24, 2024

Describe the bug 🐞

I get the error in the MWE below.

Expected behavior

It works fine as it does with SciMLBase v2.44.

Minimal Reproducible Example 👇

(@v1.10) pkg> activate --temp

(jl_BAfTFJ) pkg> add SciMLBase@2.45 OrdinaryDiffEq Plots

julia> using OrdinaryDiffEq, Plots

julia> ode = ODEProblem((du, u, p, t) -> du .= u, [1.0], (0.0, 1.0))

julia> sol = solve(ode, Tsit5());
julia> plot(sol, idxs = ((t, u) -> (t, 2 * u), 0, 1))
ERROR: Incorrect specification of `idxs`
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] (::ODESolution{…})(t::Vector{…}, ::Type{…}, idxs::Vector{…}, continuity::Symbol)
    @ SciMLBase ~/.julia/packages/SciMLBase/jh7eV/src/solutions/ode_solutions.jl:331
  [3] #_#480
    @ ~/.julia/packages/SciMLBase/jh7eV/src/solutions/ode_solutions.jl:215 [inlined]
  [4] AbstractODESolution
    @ ~/.julia/packages/SciMLBase/jh7eV/src/solutions/ode_solutions.jl:210 [inlined]
  [5] solplot_vecs_and_labels(dims::Int64, vars::Vector{…}, plott::Vector{…}, sol::ODESolution{…}, plot_analytic::Bool, plot_analytic_timeseries::Nothing)
    @ SciMLBase ~/.julia/packages/SciMLBase/jh7eV/src/solutions/solution_interface.jl:494
  [6] diffeq_to_arrays(sol::ODESolution{…}, plot_analytic::Bool, denseplot::Bool, plotdensity::Int64, tspan::Nothing, vars::Vector{…}, tscale::Symbol, plotat::Nothing)
    @ SciMLBase ~/.julia/packages/SciMLBase/jh7eV/src/solutions/solution_interface.jl:388
  [7] macro expansion
    @ ~/.julia/packages/SciMLBase/jh7eV/src/solutions/solution_interface.jl:205 [inlined]
  [8] macro expansion
    @ ~/.julia/packages/RecipesBase/BRe07/src/RecipesBase.jl:340 [inlined]
  [9] macro expansion
    @ ~/.julia/packages/SciMLBase/jh7eV/src/solutions/solution_interface.jl:199 [inlined]
 [10] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, sol::SciMLBase.AbstractTimeseriesSolution)
    @ SciMLBase ~/.julia/packages/RecipesBase/BRe07/src/RecipesBase.jl:300
 [11] _process_userrecipes!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline ~/.julia/packages/RecipesPipeline/BGM3l/src/user_recipe.jl:38
 [12] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
    @ RecipesPipeline ~/.julia/packages/RecipesPipeline/BGM3l/src/RecipesPipeline.jl:72
 [13] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
    @ Plots ~/.julia/packages/Plots/du2dt/src/plot.jl:223
 [14] plot(args::Any; kw...)
    @ Plots ~/.julia/packages/Plots/du2dt/src/plot.jl:102
 [15] top-level scope
    @ REPL[6]:1
Some type information was truncated. Use `show(err)` to see complete types.

Likely caused by #645

@ranocha ranocha added the bug Something isn't working label Jul 24, 2024
@ranocha ranocha changed the title v2.45 broke plotting with idxs as a tupe with a function v2.45 broke plotting with idxs as a tuple with a function Jul 24, 2024
@ChrisRackauckas
Copy link
Member

@AayushSabharwal I didn't see this in your test cases?

@AayushSabharwal
Copy link
Member

What are all the valid inputs to idxs?

@ranocha
Copy link
Member Author

ranocha commented Jul 26, 2024

This one is documented in https://docs.sciml.ai/DiffEqDocs/stable/basics/plot/#plot_vars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants