How to find source code of a function in DifferentialEquations.jl?

Hello everybody,
I am new to the forum.
I need to have access to detail documentation of some functions in DiffrentialEquations.jl package. I look into the source code in Github repository, but I could not find the function.
For example I need to know how to pass parameter to
EnsembleProblem(prob,prob_func=prob_func)
in solving SDE.

function prob_func(prob, i, repeat)
remake(prob,u0=rand() * prob.u0)
end

I need to know the documentation of prob_func or the source code.

Do you have any idea?

@edit

1 Like

@edit works if the code structure is simple enough, but big Julia project like DifferentialEquations.jl tend to wrap the actual algorithm in several layers of argument-handling functions which can be tedious to work through using only @edit. In such cases, I find the debugger in IDEs like Atom or VSCode quite useful. In Atom, try Juno.@enter your_function() and press Step into until you reach the level of the actual algorithm.

3 Likes

You can get access to the help mode by typing ?, so entering ? EnsembleProblem should show you some documentation.

2 Likes

I usually use vscode, F12 does not work there to find the definition of the function.

@which EnsembleProblem(prob)

Here is what I happened when I tried @which:

julia> @which EnsembleProblem prob
ERROR: LoadError: MethodError: no method matching @which(::LineNumberNode, ::Module, ::Symbol, ::Symbol)
Closest candidates are:
  @which(::LineNumberNode, ::Module, ::Symbol) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/InteractiveUtils/src/macros.jl:128
  @which(::LineNumberNode, ::Module, ::Any) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/InteractiveUtils/src/macros.jl:122
in expression starting at none:1

where prob is the output of DiscreteProblem:

julia> prob
DiscreteProblem with uType Array{Float64,1} and tType Float64. In-place: true
timespan: (0.0, 20.0)
u0: [0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0  …  0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

@which EnsembleProblem(prob)

1 Like

Hello and thank you all for the above responses.
Is there a function that allows one to obtain the exact location of a Julia function in one’s file system?
Thanks!

Again, the answer is just @which.