Stream: helpdesk (published)

Topic: ✔ Inconsistent doc and repo versions of Integrals.jl example


view this post on Zulip Anubhab Haldar (Nov 01 2022 at 16:00):

The documentation (https://docs.sciml.ai/Integrals/stable/tutorials/numerical_integrals/) has the following code:

using Integrals, Cubature, Base.Threads
function f(dx,x,p)
  Threads.@threads for i in 1:size(x,2)
    dx[i] = sum(sin.(@view(x[:,i])))
  end
end
prob = IntegralProblem(f,ones(2),3ones(2),batch=2)
sol = solve(prob,CubatureJLh(),reltol=1e-3,abstol=1e-3)

but the repo (https://github.com/SciML/Integrals.jl/blob/master/docs/src/tutorials/numerical_integrals.md) has:

using Integrals, IntegralsCubature, Base.Threads
function f(dx,x,p)
  Threads.@threads for i in 1:size(x,2)
    dx[i] = sum(sin.(@view(x[:,i])))
  end
end
prob = IntegralProblem(f,ones(2),3ones(2),batch=2)
sol = solve(prob,CubatureJLh(),reltol=1e-3,abstol=1e-3)
sol.u

This isn't really an ask for help since it's solved, but it might help others, and I don't really know how to solve the inconsistent .md part of the problem.

view this post on Zulip Brian Chen (Nov 01 2022 at 16:13):

The markdown file has the latest, unpublished version of the code. Discrepancies from the stable version (and thus the stable docs) are to be expected.

view this post on Zulip Brian Chen (Nov 01 2022 at 16:14):

If you switch to the "dev" version in the docs sidebar, both should now match

view this post on Zulip Anubhab Haldar (Nov 01 2022 at 16:27):

Very disappointed that I did not notice the versioning down there. Very nice. Thanks.

view this post on Zulip Notification Bot (Nov 01 2022 at 16:27):

Anubhab Haldar has marked this topic as resolved.


Last updated: Nov 06 2024 at 04:40 UTC