-
Notifications
You must be signed in to change notification settings - Fork 433
Allow <:AbstractArray{<:Real} for DirichletMultinomial. #2023
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
base: master
Are you sure you want to change the base?
Allow <:AbstractArray{<:Real} for DirichletMultinomial. #2023
Conversation
Tested with StaticArrays.SVector.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2023 +/- ##
=======================================
Coverage 86.36% 86.36%
=======================================
Files 146 146
Lines 8789 8789
=======================================
Hits 7591 7591
Misses 1198 1198 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| α0::T | ||
|
|
||
| function DirichletMultinomial{T}(n::Integer, α::Vector{T}) where T | ||
| function DirichletMultinomial(n::Integer, α::V) where {T <: Real, V <: AbstractVector{T}} |
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.
I doubt it matters in practice but technically removing this constructor DirichletMultinomial{T} is breaking... Maybe a search theough the JuliaHub package index can confirm that it's not used in any publix packages at least?
Maybe the safer (better?) alternative is to just keep this particular constructor for Vector{T} (maybe with a comment that it should be removed in a breaking release).
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.
You are right, there is code out there using it (probably just mindlessly copying a bad API, but nevertheless), so I will keep it.
Co-authored-by: David Müller-Widmann <[email protected]>
Co-authored-by: David Müller-Widmann <[email protected]>
Tested with StaticArrays.SVector.
Incidental: removed unneeded outer constructor.