-
-
Notifications
You must be signed in to change notification settings - Fork 293
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
Error from StatsBase
that only occurs inside Pluto
#1958
Comments
Thanks for reporting ! This is due to the automatical function wrapping (see #720). You can workaround the problem by defining a dummy function inside the same cell ( Reproducer outside Pluto: function test(x)
pairwise(eachindex(x); symmetric=true) do j,i
pval = pvalue(SignedRankTest(x[i], x[j]))
(pval, pval)
end
end
x = [rand(1000) for _=1:10]
test(x) # Fails Interestingly, using a global variable does not trigger the bug: function test2()
pairwise(eachindex(x); symmetric=true) do j,i
pval = pvalue(SignedRankTest(x[i], x[j]))
(pval, pval)
end
end
test2() # works This seems related to the use of |
Interesting. Am I right in thinking this is not currently documented? Maybe this should be mentioned around the docs about environments (since it likewise relates to reproducibility).
|
We should document this. It's not really a reproducibility problem, but more a problem where code runs differently inside Pluto than outside of it (which we also want to avoid). |
I was thinking or "reproducibility" in the sense of reproducing a problem outside of Pluto, so to me it seemed natural to look in the docs under this heading when trying to figure out why there might be a difference. (but I can see why you might want to call it something different). |
The following simple notebook generates an error, apparently from
StatsBase
, which is not reproduced when the notebook is run manually from the REPL in a clean environment.To test this cleanly, I tried running Pluto in a new temporary environment, and also running the notebook directly in a new temporary environment. When it's run from the REPL, it works fine:
The text was updated successfully, but these errors were encountered: