You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The output functions defined in src/output-analysis.jl, e.g. total_biomass() fail when using interpolated solution.
A solution might be to add DiffEqArray to accepted types or to relax the type constrain?
A reproducible example:
vegan =Foodweb([:ours=>:plant])
m =default_model(vegan)
sol =simulate(m, rand(length(get_species_names(m))), 100)
# Works
julia>total_biomass(sol[:, end])
0.5795782663712777
# Interpolate the solution to get equally sized time steps
last_t =round(sol.t[end])
sol2 =sol(collect(last_t-50:1:last_t))
# Fail because sol2 is of type DiffEqArray
julia>total_biomass(sol2)
ERROR: MethodError: no method matching total_biomass(::DiffEqArray{Float64, 2, Vector{…}, Vector{…}, @NamedTuple{…}, ODESolution{…}, Nothing})
Closest candidates are:total_biomass(::AbstractVector)
@ EcologicalNetworksDynamics ~/.julia/packages/EcologicalNetworksDynamics/R3OJZ/src/output-analysis.jl:125total_biomass(::SciMLBase.AbstractODESolution)
@ EcologicalNetworksDynamics ~/.julia/packages/EcologicalNetworksDynamics/R3OJZ/src/output-analysis.jl:111
Stacktrace:
[1] top-level scope
@ REPL[180]:1
[2] top-level scope
@ none:1
Some type information was truncated. Use `show(err)` to see complete types.
The text was updated successfully, but these errors were encountered:
The output functions defined in
src/output-analysis.jl
, e.g.total_biomass()
fail when using interpolatedsolution
.A solution might be to add
DiffEqArray
to accepted types or to relax the type constrain?A reproducible example:
The text was updated successfully, but these errors were encountered: