Partition EnsembleSolution before using EnsembleSummary

I’ve started using EnsembleProblem in DifferentialEquations.jl and I like how simple it is to use with EnsembleSummary to create nice summary statistics and plots.

However, I would like to partition EnsembleSolution into different groups before summarising. For example, partition into two groups based on whether the solution reached a steady state or not.

This is what I’m imagining:

ensemble_prob = EnsembleProblem(prob, prob_func=prob_func)
sim = solve(ensemble_prob, trajectories=100)

sim_groupA = ... # e.g. solution reached a steady state
sim_groupB = ... # e.g. solution did not reach a steady state

summ_groupA = EnsembleSummary(sim_groupA)
summ_groupB = EnsembleSummary(sim_groupB)

plot(summ_groupA)
plot(summ_groupB)

Is there a simple way to do this? I couldn’t find anything online that explained if this was possible. The only thing I can think of looking at sim.u directly and not using EnsembleSummary at all.

you can use sim[i].retcode to know if it converged or not. Now, generating the summaries from that… I need to work on that part of the interface first.