-
Notifications
You must be signed in to change notification settings - Fork 413
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
Make symbols in deprecation warnings more explicit #1428
Conversation
No, I definitely think users should use Also a no on the second point, we agreed to not re-export FillArrays (and other dependencies) but instead document them clearly: #1368 |
I wonder if the deprecation message becomes clearer if we use ┌ Warning: `MvNormal(d::Int, σ::Real)` is deprecated, use `MvNormal(LinearAlgebra.Diagonal(FillArrays.Fill(σ ^ 2, d)))` instead. which would match our (ideal) documentation (all external structs and functions are qualified). |
It seems to work locally (don't pay attention to the stupid example): julia> using LinearAlgebra
julia> g(x) = sum(abs2, x)
g (generic function with 1 method)
julia> Base.@deprecate f(x) g(LinearAlgebra.Diagonal(x))
f (generic function with 1 method)
julia> f(rand(3, 3))
┌ Warning: f(x) is deprecated, use g(LinearAlgebra.Diagonal(x)) instead.
│ caller = top-level scope at REPL[4]:1
└ @ Core REPL[4]:1
0.2616974132900723 |
I love it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good! While you're at it, maybe update the deprecations in mvnormalcanon.jl
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! I'll merge when tests pass.
Test errors are unrelated (recent release of PDMats uncovered a bug in the implementation of |
The deprecation warning read:
However,
Fill
is not exported by Distributions and is likely to cause much searching for many readers.This PR fixes it by using
fill
instead ofFill
. Another solution would be toexport Fill
insrc/Distributions.jl
.cc: @devmotion