Skip to content

Commit

Permalink
Merge pull request #1359 from JuliaStats/dw/fix_poisson
Browse files Browse the repository at this point in the history
Fix #1358
  • Loading branch information
mschauer authored Jul 5, 2021
2 parents 34df63d + be7e632 commit 43cd959
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Distributions"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
authors = ["JuliaStats"]
version = "0.25.8"
version = "0.25.9"

[deps]
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
Expand Down
2 changes: 1 addition & 1 deletion src/univariates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ macro _delegate_statsfuns(D, fpre, psyms...)
pargs = [Expr(:(.), :d, Expr(:quote, s)) for s in psyms]

# output type of `quantile` etc.
T = :($D isa DiscreteUnivariateDistribution ? Int : Real)
T = :($D <: DiscreteUnivariateDistribution ? Int : Real)

return quote
$Distributions.pdf(d::$D, x::Real) = $(fpdf)($(pargs...), x)
Expand Down
9 changes: 9 additions & 0 deletions test/univariates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,12 @@ for c in ["discrete",
verify_and_test_drive(jsonfile, ARGS, 10^6)
println()
end

# #1358
@testset "Poisson quantile" begin
d = Poisson(1)
@test quantile(d, 0.2) isa Int
@test cquantile(d, 0.4) isa Int
@test invlogcdf(d, log(0.2)) isa Int
@test invlogccdf(d, log(0.6)) isa Int
end

2 comments on commit 43cd959

@devmotion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/40267

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.25.9 -m "<description of version>" 43cd959a10e11771e16ecc53725e7963351b63db
git push origin v0.25.9

Please sign in to comment.