You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nice looks good. As we discussed its a lot of copy and paste so ideally we should have an issue to track changes we can make to reduce this (either here or upstream).
To flesh this out a bit. Implementing SafePoisson and SafeNegativeBinomial was done in a really boilerplate way, involving a lot of copy and paste from Distributions.jl and RandomPoisson.jl.
Possible preferable alternatives:
A macro based approach which generates the various functions to make a Safe version of a dist e.g.
@make_safe_distr Poisson
# SafePoisson is available
A traits based approach where we can make a trait-based dispatch without having to redeclare a lot of auxillary functions e.g. something like
@traitdef IsUnsafe{Poisson}
@traitfnrand(d::Poisson) where {Poisson; IsUnsafe{Poisson}} =safe_rand_method(d)
Originally posted by @seabbs in #418 (review)
The text was updated successfully, but these errors were encountered: