SciML / SciMLBase.jl

The Base interface of the SciML ecosystem
https://docs.sciml.ai/SciMLBase/stable
MIT License
131 stars 97 forks source link

[WIP] Fix Ensemble indexing when `output_func` is used #607

Open SebastianM-C opened 8 months ago

SebastianM-C commented 8 months ago

When output_func is used, the resulting type in sim.u[i] is no longer <: AbstractVectorOfArray, so we need to avoid assuming that like in #599, #602 and #604

I was thinking of the following output functions as tests:

function output_func(sol, i)
    (x=sol[1, :], t=sol.t), false
end

function output_func(sol, i)
    last(sol), false
end

function output_func(sol, i)
    [first(sol), last(sol)], false
end

For the plot recipes I was thinking that we could test if no warnings are thrown by the plot calls. That should catch depwarns too and if there's any error in the recipes, the test would error.

This PR is WIP and not yet ready.

codecov[bot] commented 8 months ago

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (e46e491) 39.96% compared to head (4a8e883) 39.94%.

Files Patch % Lines
src/ensemble/ensemble_analysis.jl 0.00% 5 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #607 +/- ## ========================================== - Coverage 39.96% 39.94% -0.02% ========================================== Files 54 54 Lines 4076 4078 +2 ========================================== Hits 1629 1629 - Misses 2447 2449 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

SebastianM-C commented 7 months ago

There are still some cases to handle. As for tests, the recipes don't have any tests, I was thinking to ad some with @test_nowarn.