No matching method in 02-advanced_ODE_solving.ipynb tutorial

Hi,

I am running a tutorial: 02-advanced_ODE_solving in a Jupyter notebook. I got part of the way down the notebook, and eventually got an error that indicated a routine was not found. I am using Julia 1.31 . If there is a better place to post this, please let me know. Thanks.

I omit the full trace.

you might want to join the chat room for these quicker questions. When you updated DiffEqTutorials, what version did you get? Your last issue sounded like you hit a version clash, and I put out a release today to fix some upper bound issues given what you saw.

This has nothing to do with VS Code, right? So posting in a different category will probably lead to better answers.

Yes, moved to usage.

Basically, I think one of our dependencies isn’t playing nice with the rest of the ecosystem, and I think it’s https://github.com/yuyichao/FunctionWrappers.jl/issues/11

Thanks. The correct choice was not obvious to me.

Thanks. So how do I update my registry? Simply by typing

] update

Is that enough? Thanks.

What about in a notebook?

That should be enough, and it can be done in a notebook. If that doesn’t work, then I’ll need to see your ]st. But last night after tagging I was able to ]add DiffEqTutorials and got v0.3.0 with the right package versions, so in a clean install it should be good to go.

Great! It seems to be working now. One usage question:

#using SparsityDetection, SparseArrays
input = rand(32,32,2)
output = similar(input)

input does not have NaNs.
However, output does. I know the array is uninitialized, by why are NaNs allowed?

SparsityDetection isn’t actually running the code. It’s using that input information to know the structure of the inputs, and then determines what the connectivity of the variables would be in order to get the sparsity pattern for the Jacobian. So it doesn’t need or use the values at all.

For reference, it’s https://github.com/JuliaDiffEq/SparsityDetection.jl and the paper is https://openreview.net/pdf?id=rJlPdcY38B

1 Like

I jumped the gun. I get the same error:

Here is my Pkg status:

Project DiffEqTutorials v0.2.1
Status ~/Documents/src/2019/DiffEqTutorials.jl/Project.toml
[2169fc97] AlgebraicMultigrid v0.2.2
[7e558dbc] ArbNumerics v1.0.2
[6e4b80f9] BenchmarkTools v0.5.0
[be33ccc6] CUDAnative v2.10.2
[159f3aea] Cairo v1.0.2
[3a865a2d] CuArrays v1.7.2
[55939f99] DecFP v0.4.10
[abce61dc] Decimals v0.4.1
[ebbdde9d] DiffEqBayes v2.5.0
[eb300fae] DiffEqBiological v4.2.0
[459566f4] DiffEqCallbacks v2.12.0
[f3b72e0c] DiffEqDevTools v2.18.0
[9fdde737] DiffEqOperators v4.8.1
[1130ab10] DiffEqParamEstim v1.12.0
[055956cb] DiffEqPhysics v3.5.0
[0c46a032] DifferentialEquations v6.11.0
[31c24e10] Distributions v0.22.4
[497a8b3b] DoubleFloats v1.0.3
[f6369f11] ForwardDiff v0.10.9
[c91e804a] Gadfly v1.2.0
[7073ff75] IJulia v1.21.1
[23fbe1c1] Latexify v0.12.3
[eff96d63] Measurements v2.2.0
[961ee093] ModelingToolkit v1.2.8
[2774e3e8] NLsolve v4.3.0
[429524aa] Optim v0.20.1
[1dea7af3] OrdinaryDiffEq v5.29.0
[65888b18] ParameterizedFunctions v4.2.1
[91a5bcdd] Plots v0.28.4
[d330b81b] PyPlot v2.8.2
[731186ca] RecursiveArrayTools v2.1.0
[47a9eef4] SparseDiffTools v1.3.3
[684fba80] SparsityDetection v0.1.2
[90137ffa] StaticArrays v0.12.1
[f3b207a7] StatsPlots v0.14.0
[c3572dad] Sundials v3.8.3
[1986cc42] Unitful v1.0.0
[44d3d7a6] Weave v0.9.1
[b77e0a4c] InteractiveUtils
[37e2e46d] LinearAlgebra
[44cfe95a] Pkg

Yeah so you don’t have last night’s tutorial update. Maybe it’s not serving it to you because of package bounds? Try and force it: ]add DiffEqTutorials@0.3.0

Ok, I did not realize that it was the tutorial that was updated. I downloaded it to my computer using git.
Your approach is an alternative. I am working outside Atom when using notebooks. That is not the preferred approach ?

Chris,

I updated by repository, but still the error persists. I checked the github where the tutorials are located. Here is an image.

I do not see any update from last night. I am obviously looking in the wrong place.

More detailed: is this the change you are referring to? I do have this updated file in my repository.


Followup:

Still does not work. This time, I started from within Juno and typed:

using Pkg
pkg"add https://github.com/JuliaDiffEq/DiffEqTutorials.jl"
using DiffEqTutorials
DiffEqTutorials.open_notebooks()

This took me to the notebook. I opened the 02… tutorial. Then I typed the following inside a cell

] status

and got the message that I had an empty environment.

Project DiffEqTutorials v0.3.0
Status ~/.julia/packages/DiffEqTutorials/1VbcB/Project.toml
(empty environment)

Then I typed:

using DifferentialEq

which executed fine. But then:

using Plots

gave the error:

ArgumentError: Package Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] is required but does not seem to be installed:

  • Run Pkg.instantiate() to install all recorded dependencies.

Stacktrace:
[1] _require(::Base.PkgId) at ./loading.jl:998
[2] require(::Base.PkgId) at ./loading.jl:927
[3] require(::Module, ::Symbol) at ./loading.jl:922
[4] top-level scope at In[16]:2

Question: Why would DifferentialEquations package load and Plots not load?
Question: What is the expected default environment when a notebook is loaded from within Juno?

Thanks,

Oh, I guess the issue is that yes, the tutorials does not put all of its dependencies into your global environment when it runs on its own. When building the tutorials I always do:

using Pkg, DiffEqTutorials
cd(joinpath(dirname(pathof(DiffEqTutorials)), ".."))
Pkg.pkg"activate ."
Pkg.pkg"instantiate"

as mentioned in https://github.com/JuliaDiffEq/DiffEqTutorials.jl#contributing to enter the DiffEqTutorials environment. I guess in the tutorials the user won’t necessarily already have the package accessible.

1 Like

Thank you Chris. Sorry for all the questions. Cannot read everything.

No worries. And I’m using you as a guinni pig instead of leading you straight to the answer, which here would’ve been “just run the code bits in whatever and add the packages on your own”. I wanna make sure the tutorials just “install and run” :slight_smile:, but indeed hacking it onto the package system doesn’t work perfectly because Julia naturally shields the dependencies of a package from a user’s main environment (for good reason). I might want to work around that… or as part of the tutorial tell people to enter the environment? Hard to tell.