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

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

SebastianM-C
Copy link
Contributor

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.

Copy link

codecov bot commented Feb 1, 2024

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 ⚠️
Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@AayushSabharwal AayushSabharwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Are these functions tested anywhere, in both cases (.u isa AbstractVectorOfArray and otherwise)?

@SebastianM-C
Copy link
Contributor Author

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.

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