Skip to content
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

Fix failing tests on 1.11-beta #1862

Merged
merged 6 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ name: CI

on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'
workflow_dispatch:
merge_group:

concurrency:
# Skip intermediate builds: always.
Expand Down
6 changes: 3 additions & 3 deletions test/univariate/continuous/semicircle.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Distributions
using Random: MersenneTwister
using StableRNGs
using Test

d = Semicircle(2.0)
Expand Down Expand Up @@ -39,8 +39,8 @@ d = Semicircle(2.0)
@test quantile(d, .5) == .0
@test quantile(d, 1.0) == +2.0

rng = MersenneTwister(0)
for r in rand(rng, Uniform(0,10), 5)
rng = StableRNG(123)
@testset for r in rand(rng, Uniform(0,10), 5)
N = 10^4
semi = Semicircle(r)
sample = rand(rng, semi, N)
Expand Down
14 changes: 7 additions & 7 deletions test/univariate/locationscale.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function test_location_scale(
@test invlogccdf(dtest, log(0.5)) ≈ invlogccdf(dref, log(0.5))
@test invlogccdf(dtest, log(0.8)) ≈ invlogccdf(dref, log(0.8))

r = Array{float(eltype(dtest))}(undef, 100000)
r = Array{float(eltype(dtest))}(undef, 200000)
if ismissing(rng)
rand!(dtest, r)
else
Expand Down Expand Up @@ -148,19 +148,19 @@ end
rng = MersenneTwister(123)

@testset "Normal" begin
for _rng in (missing, rng), sign in (1, -1)
@testset for _rng in (missing, rng), sign in (1, -1)
test_location_scale_normal(_rng, 0.3, sign * 0.2, 0.1, 0.2)
test_location_scale_normal(_rng, -0.3, sign * 0.1, -0.1, 0.3)
test_location_scale_normal(_rng, 1.3, sign * 0.4, -0.1, 0.5)
end
test_location_scale_normal(rng, ForwardDiff.Dual(0.3), 0.2, 0.1, 0.2)
end
@testset "DiscreteNonParametric" begin
probs = normalize!(rand(10), 1)
for _rng in (missing, rng), sign in (1, -1)
test_location_scale_discretenonparametric(_rng, 1//3, sign * 1//2, 1:10, probs)
test_location_scale_discretenonparametric(_rng, -1//4, sign * 1//3, (-10):(-1), probs)
test_location_scale_discretenonparametric(_rng, 6//5, sign * 3//2, 15:24, probs)
_probs = normalize!(rand(10), 1)
@testset for _rng in (missing, rng), sign in (1, -1)
test_location_scale_discretenonparametric(_rng, 1//3, sign * 1//2, 1:10, _probs)
test_location_scale_discretenonparametric(_rng, -1//4, sign * 1//3, (-10):(-1), _probs)
test_location_scale_discretenonparametric(_rng, 6//5, sign * 3//2, 15:24, _probs)
end
end

Expand Down