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

Add input preparation to ensemble problems #525

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

LilithHafner
Copy link
Member

@LilithHafner LilithHafner commented Oct 18, 2023

Fixup for #519 (I didn't see these entry points)
Does not fix SciML/diffeqpy#122 (comment).

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #525 (681dad8) into master (578352c) will decrease coverage by 6.53%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##           master     #525      +/-   ##
==========================================
- Coverage   49.55%   43.03%   -6.53%     
==========================================
  Files          53       53              
  Lines        3925     3925              
==========================================
- Hits         1945     1689     -256     
- Misses       1980     2236     +256     
Files Coverage Δ
src/ensemble/ensemble_problems.jl 34.61% <83.33%> (+7.34%) ⬆️

... and 15 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@LilithHafner LilithHafner marked this pull request as draft October 18, 2023 17:13
@LilithHafner LilithHafner marked this pull request as ready for review October 18, 2023 17:29
@ChrisRackauckas ChrisRackauckas merged commit 50126b9 into SciML:master Oct 18, 2023
62 of 70 checks passed
@ChrisRackauckas
Copy link
Member

I see, does not fix 😅

For some reason I get init of nothing:

>>> sol = de.solve(ensembleprob,de.Tsit5(),de.EnsembleSerial(),trajectories=10000,saveat=0.01)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\accou\.julia\packages\PythonCall\qTEA1\src\jlwrap\any.jl", line 208, in __call__
    return self._jl_callmethod($(pyjl_methodnum(pyjlany_call)), args, kwargs)
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
juliacall.JuliaError: MethodError: no method matching init(::Nothing, ::OrdinaryDiffEq.Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; saveat::Float64)

Closest candidates are:
  init(!Matched::SciMLBase.OptimizationProblem, ::Any, !Matched::Any...; kwargs...)
   @ SciMLBase C:\Users\accou\.julia\packages\SciMLBase\tXu8A\src\solve.jl:146
  init(!Matched::SciMLBase.PDEProblem, ::SciMLBase.AbstractDEAlgorithm, !Matched::Any...; kwargs...)
   @ DiffEqBase C:\Users\accou\.julia\packages\DiffEqBase\xSmHR\src\solve.jl:1116
  init(!Matched::SciMLBase.AbstractJumpProblem, ::Any...; kwargs...)
   @ DiffEqBase C:\Users\accou\.julia\packages\DiffEqBase\xSmHR\src\solve.jl:499
  ...

Stacktrace:
  [1] solve(::Nothing, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:saveat,), Tuple{Float64}}})
    @ CommonSolve C:\Users\accou\.julia\packages\CommonSolve\JfpfI\src\CommonSolve.jl:23
  [2] batch_func(i::Int64, prob::SciMLBase.EnsembleProblem{SciMLBase.ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, SciMLBase.ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#k#545"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x946926fe, 0xab7b8dc2, 0x707dbba2, 0x8b060826, 0xe63fdf5b), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xaf9b47a5, 0x8d86fb18, 0x65c64d40, 0xf8480c5a, 0x8614cffa), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, Vector{Symbol}, ModelingToolkit.var"#637#generated_observed#555"{Bool, ModelingToolkit.ODESystem, Dict{Any, Any}, Vector{SymbolicUtils.BasicSymbolic{Real}}}, Nothing, ModelingToolkit.ODESystem}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ComposedFunction{typeof(SciMLBasePythonCallExt._pyconvert), Py}, typeof(SciMLBase.DEFAULT_OUTPUT_FUNC), typeof(SciMLBase.DEFAULT_REDUCTION), Nothing}, alg::OrdinaryDiffEq.Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:saveat,), Tuple{Float64}}})
    @ SciMLBase C:\Users\accou\.julia\packages\SciMLBase\tXu8A\src\ensemble\basic_ensemble_solve.jl:100
  [3] batch_func
    @ C:\Users\accou\.julia\packages\SciMLBase\tXu8A\src\ensemble\basic_ensemble_solve.jl:95 [inlined]
  [4] (::SciMLBase.var"#606#607"{Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:saveat,), Tuple{Float64}}}, SciMLBase.EnsembleProblem{SciMLBase.ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, SciMLBase.ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#k#545"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x946926fe, 0xab7b8dc2, 0x707dbba2, 0x8b060826, 0xe63fdf5b), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xaf9b47a5, 0x8d86fb18, 0x65c64d40, 0xf8480c5a, 0x8614cffa), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, Vector{Symbol}, ModelingToolkit.var"#637#generated_observed#555"{Bool, ModelingToolkit.ODESystem, Dict{Any, Any}, Vector{SymbolicUtils.BasicSymbolic{Real}}}, Nothing, ModelingToolkit.ODESystem}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ComposedFunction{typeof(SciMLBasePythonCallExt._pyconvert), Py}, typeof(SciMLBase.DEFAULT_OUTPUT_FUNC), typeof(SciMLBase.DEFAULT_REDUCTION), Nothing}, OrdinaryDiffEq.Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}})(i::Int64)
    @ SciMLBase C:\Users\accou\.julia\packages\SciMLBase\tXu8A\src\ensemble\basic_ensemble_solve.jl:154
  [5] responsible_map(f::Function, II::UnitRange{Int64})
    @ SciMLBase C:\Users\accou\.julia\packages\SciMLBase\tXu8A\src\ensemble\basic_ensemble_solve.jl:147
  [6] solve_batch(prob::SciMLBase.EnsembleProblem{SciMLBase.ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, SciMLBase.ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#k#545"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x946926fe, 0xab7b8dc2, 0x707dbba2, 0x8b060826, 0xe63fdf5b), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xaf9b47a5, 0x8d86fb18, 0x65c64d40, 0xf8480c5a, 0x8614cffa), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, Vector{Symbol}, ModelingToolkit.var"#637#generated_observed#555"{Bool, ModelingToolkit.ODESystem, Dict{Any, Any}, Vector{SymbolicUtils.BasicSymbolic{Real}}}, Nothing, ModelingToolkit.ODESystem}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ComposedFunction{typeof(SciMLBasePythonCallExt._pyconvert), Py}, typeof(SciMLBase.DEFAULT_OUTPUT_FUNC), typeof(SciMLBase.DEFAULT_REDUCTION), Nothing}, alg::OrdinaryDiffEq.Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, ::SciMLBase.EnsembleSerial, II::UnitRange{Int64}, pmap_batch_size::Int64; kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:saveat,), Tuple{Float64}}})
    @ SciMLBase C:\Users\accou\.julia\packages\SciMLBase\tXu8A\src\ensemble\basic_ensemble_solve.jl:153
  [7] solve_batch
    @ C:\Users\accou\.julia\packages\SciMLBase\tXu8A\src\ensemble\basic_ensemble_solve.jl:152 [inlined]
  [8] macro expansion
    @ .\timing.jl:393 [inlined]
  [9] __solve(prob::SciMLBase.EnsembleProblem{SciMLBase.ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, SciMLBase.ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#k#545"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x946926fe, 0xab7b8dc2, 0x707dbba2, 0x8b060826, 0xe63fdf5b), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xaf9b47a5, 0x8d86fb18, 0x65c64d40, 0xf8480c5a, 0x8614cffa), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, Vector{Symbol}, ModelingToolkit.var"#637#generated_observed#555"{Bool, ModelingToolkit.ODESystem, Dict{Any, Any}, Vector{SymbolicUtils.BasicSymbolic{Real}}}, Nothing, ModelingToolkit.ODESystem}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, ComposedFunction{typeof(SciMLBasePythonCallExt._pyconvert), Py}, typeof(SciMLBase.DEFAULT_OUTPUT_FUNC), typeof(SciMLBase.DEFAULT_REDUCTION), Nothing}, alg::OrdinaryDiffEq.Tsit5{typeof(OrdinaryDiffEq.trivial_limiter!), typeof(OrdinaryDiffEq.trivial_limiter!), Static.False}, ensemblealg::SciMLBase.EnsembleSerial; trajectories::Int64, batch_size::Int64, pmap_batch_size::Int64, kwargs::Base.Pairs{Symbol, Float64, Tuple{Symbol}, NamedTuple{(:saveat,), Tuple{Float64}}})
    @ SciMLBase C:\Users\accou\.julia\packages\SciMLBase\tXu8A\src\ensemble\basic_ensemble_solve.jl:64
 [10] #solve#44
    @ C:\Users\accou\.julia\packages\DiffEqBase\xSmHR\src\solve.jl:1053 [inlined]
 [11] pyjlany_call(self::typeof(CommonSolve.solve), args_::Py, kwargs_::Py)
    @ PythonCall C:\Users\accou\.julia\packages\PythonCall\qTEA1\src\jlwrap\any.jl:34
 [12] _pyjl_callmethod(f::Any, self_::Ptr{PythonCall.C.PyObject}, args_::Ptr{PythonCall.C.PyObject}, nargs::Int64)
    @ PythonCall C:\Users\accou\.julia\packages\PythonCall\qTEA1\src\jlwrap\base.jl:69
 [13] _pyjl_callmethod(o::Ptr{PythonCall.C.PyObject}, args::Ptr{PythonCall.C.PyObject})
    @ PythonCall.C C:\Users\accou\.julia\packages\PythonCall\qTEA1\src\cpython\jlwrap.jl:47

@LilithHafner LilithHafner deleted the lh/prepare branch October 18, 2023 22:04
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