Skip to content

Commit 000bb01

Browse files
committed
remove deprecated hide_progress and use_threads kwargs
1 parent e9a139b commit 000bb01

File tree

5 files changed

+7
-43
lines changed

5 files changed

+7
-43
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ MixedModels v5.0.0 Release Notes
33
- Optimization is now performed _without constraints_. In a post-fitting step, the the Cholesky factor is canonicalized to have non-negative diagonal elements. [#840]
44
- The default optimizer has changed to NLopt's implementation of NEWUOA where possible. NLopt's implementation fails on 1-dimensional problems, so in the case A single, scalar random effect, BOBYQA is used instead. In the future, the default optimizer backend will likely change to PRIMA and NLopt support will be moved to an extension. Blocking this change in backend is an issue with PRIMA.jl when running in VSCode's built-in REPL on Linux. [#840]
55
- [BREAKING] Support for constrained optimization has been completely removed, i.e. the field `lowerbd` has been removed from `OptSummary`.
6+
- [BREAKING] The deprecated `use_threads` kwarg has been dropped from `parametricbootstrap`. It had been a no-op since v4.10.0. [#841]
7+
- [BREAKING] The deprecated `hide_progress` kwarg has been dropped from `parametricbootstrap`. It had been replaced by `progress` since v4.22.0. [#841]
68

79

810
MixedModels v4.38.0 Release Notes

src/bootstrap.jl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -217,18 +217,9 @@ function parametricbootstrap(
217217
β::AbstractVector=fixef(morig),
218218
σ=morig.σ,
219219
θ::AbstractVector=morig.θ,
220-
use_threads::Bool=false,
221220
progress::Bool=true,
222-
hide_progress::Union{Bool,Nothing}=nothing,
223221
optsum_overrides=(;),
224222
) where {T}
225-
if !isnothing(hide_progress)
226-
Base.depwarn(
227-
"`hide_progress` is deprecated, please use `progress` instead." *
228-
"NB: `progress` is a positive action, i.e. `progress=true` means show the progress bar.",
229-
:parametricbootstrap; force=true)
230-
progress = !hide_progress
231-
end
232223
if σ !== missing
233224
σ = T(σ)
234225
end
@@ -248,10 +239,6 @@ function parametricbootstrap(
248239

249240
β_names = Tuple(Symbol.(coefnames(morig)))
250241

251-
use_threads && Base.depwarn(
252-
"use_threads is deprecated and will be removed in a future release",
253-
:parametricbootstrap,
254-
)
255242
samp = replicate(n; progress) do
256243
simulate!(rng, m; β, σ, θ)
257244
refit!(m; progress=false, fitlog=false)

src/utilities.jl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -129,19 +129,8 @@ Return a vector of the values of `n` calls to `f()` - used in simulations where
129129
bar is automatically disabled for non-interactive (i.e. logging) contexts.
130130
"""
131131
function replicate(
132-
f::Function, n::Integer; use_threads=false, hide_progress=nothing, progress=true
132+
f::Function, n::Integer; progress=true
133133
)
134-
use_threads && Base.depwarn(
135-
"use_threads is deprecated and will be removed in a future release",
136-
:replicate,
137-
)
138-
if !isnothing(hide_progress)
139-
Base.depwarn(
140-
"`hide_progress` is deprecated, please use `progress` instead." *
141-
"NB: `progress` is a positive action, i.e. `progress=true` means show the progress bar.",
142-
:replicate; force=true)
143-
progress = !hide_progress
144-
end
145134
# and we want some advanced options
146135
p = Progress(n; output=Base.stderr, enabled=progress && !_is_logging(stderr))
147136
# get the type

test/bootstrap.jl

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include("modelcache.jl")
1515

1616
function quickboot(m, n=2)
1717
return parametricbootstrap(MersenneTwister(42), n, m;
18-
progress=false, use_threads=false,
18+
progress=false,
1919
optsum_overrides=(; ftol_rel=1e-8))
2020
end
2121

@@ -91,11 +91,8 @@ end
9191
# two implicit tests
9292
# 1. type conversion of ints to floats
9393
# 2. test method for default RNG
94-
@test_logs((:warn, r"hide_progress"),
95-
parametricbootstrap(1, fm, β=[1], σ=1, hide_progress=true))
96-
9794
bsamp = parametricbootstrap(MersenneTwister(1234321), 100, fm;
98-
use_threads=false, progress=false)
95+
progress=false)
9996
@test isa(propertynames(bsamp), Vector{Symbol})
10097
@test length(bsamp.objective) == 100
10198
@test keys(first(bsamp.fits)) == (:objective, , , :se, )
@@ -106,13 +103,13 @@ end
106103

107104
@testset "optsum_overrides" begin
108105
bsamp2 = parametricbootstrap(MersenneTwister(1234321), 100, fm;
109-
use_threads=false, progress=false,
106+
progress=false,
110107
optsum_overrides=(; ftol_rel=1e-8))
111108
# for such a simple, small model setting the function value
112109
# tolerance has little effect until we do something extreme
113110
@test bsamp.objective bsamp2.objective
114111
bsamp2 = parametricbootstrap(MersenneTwister(1234321), 100, fm;
115-
use_threads=false, progress=false,
112+
progress=false,
116113
optsum_overrides=(; ftol_rel=1.0))
117114
@test !(bsamp.objective bsamp2.objective)
118115
end
@@ -130,12 +127,6 @@ end
130127
@test only(unique(coefp.coefname)) == Symbol("(Intercept)")
131128
@test propertynames(coefp) == [:iter, :coefname, , :se, :z, :p]
132129

133-
@testset "threaded bootstrap" begin
134-
@test_logs (:warn, r"use_threads is deprecated") parametricbootstrap(
135-
MersenneTwister(1234321), 1, fm;
136-
use_threads=true, progress=false)
137-
end
138-
139130
@testset "zerocorr + Base.length + ftype" begin
140131
fmzc = models(:sleepstudy)[2]
141132
pbzc = parametricbootstrap(MersenneTwister(42), 5, fmzc, Float16;

test/utilities.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ end
3939
@test isconstant(Union{Int,Missing}[missing, missing, missing])
4040
end
4141

42-
@testset "replicate" begin
43-
@test_logs (:warn, r"use_threads is deprecated") replicate(string, 1; use_threads=true)
44-
@test_logs (:warn, r"hide_progress") replicate(string, 1; hide_progress=true)
45-
end
46-
4742
@testset "datasets" begin
4843
@test isa(MixedModels.datasets(), Vector{String})
4944
@test length(MixedModels.dataset(:dyestuff)) == 2

0 commit comments

Comments
 (0)