Skip to content

Commit

Permalink
begin supporting public keyword (#776)
Browse files Browse the repository at this point in the history
* begin supporting `public` keyword

* move dataset[s] to public (was incorrectly exported)

* remove qualification from precompile block

* suppress some logs in tests

* NEWS, version bump

* suppress more

* BlueStyle
  • Loading branch information
palday committed Jul 17, 2024
1 parent a45fc14 commit b551a03
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
MixedModels v4.25.2 Release Notes
==============================
- Use `public` keyword so that users don't see unnecessary docstring warnings on 1.11+. [#776]
- Fix accidental export of `dataset` and `datasets` and make them `public` instead. [#776]

MixedModels v4.25.1 Release Notes
==============================
- Use more sophisticated checks on property names in `restoreoptsum` to allow for optsums saved by pre-v4.25 versions to be used with this version and later. [#775]
Expand Down Expand Up @@ -543,3 +548,4 @@ Package dependencies
[#772]: https://github.com/JuliaStats/MixedModels.jl/issues/772
[#773]: https://github.com/JuliaStats/MixedModels.jl/issues/773
[#775]: https://github.com/JuliaStats/MixedModels.jl/issues/775
[#776]: https://github.com/JuliaStats/MixedModels.jl/issues/776
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name = "MixedModels"
uuid = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316"
author = ["Phillip Alday <me@phillipalday.com>", "Douglas Bates <dmbates@gmail.com>", "Jose Bayoan Santiago Calderon <jbs3hp@virginia.edu>"]
version = "4.25.1"
version = "4.25.2"

[deps]
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
BSplineKit = "093aae92-e908-43d7-9660-e50ee39d5a0a"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
DataAPI = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
GLM = "38e38edf-8417-5370-95a0-9cbb8c7f171a"
Expand Down Expand Up @@ -33,6 +34,7 @@ TypedTables = "9d95f2ec-7b3d-5a63-8d20-e2491e220bb9"
Aqua = "0.8"
Arrow = "1, 2"
BSplineKit = "0.14, 0.15, 0.16, 0.17"
Compat = "4.10"
DataAPI = "1"
DataFrames = "1"
Distributions = "0.21, 0.22, 0.23, 0.24, 0.25"
Expand Down
9 changes: 5 additions & 4 deletions src/MixedModels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using Arrow: Arrow
using Base: Ryu, require_one_based_indexing
using BSplineKit: BSplineKit, BSplineOrder, Natural, Derivative, SplineInterpolation
using BSplineKit: interpolate
using Compat: @compat
using DataAPI: DataAPI, levels, refpool, refarray, refvalue
using Distributions: Distributions, Bernoulli, Binomial, Chisq, Distribution, Gamma
using Distributions: InverseGaussian, Normal, Poisson, ccdf
Expand Down Expand Up @@ -89,8 +90,6 @@ export @formula,
condVar,
condVartables,
confint,
dataset,
datasets,
deviance,
dispersion,
dispersion_parameter,
Expand Down Expand Up @@ -160,6 +159,8 @@ export @formula,
# TODO: move this to the correct spot in list once we've decided on name
export savereplicates, restorereplicates

@compat public rePCA, PCA, dataset, datasets

"""
MixedModel
Expand Down Expand Up @@ -209,8 +210,8 @@ include("profile/profile.jl")
@setup_workload begin
# Putting some things in `setup` can reduce the size of the
# precompile file and potentially make loading faster.
sleepstudy = MixedModels.dataset(:sleepstudy)
contra = MixedModels.dataset(:contra)
sleepstudy = dataset(:sleepstudy)
contra = dataset(:contra)
progress = false
@compile_workload begin
# all calls in this block will be precompiled, regardless of whether
Expand Down
6 changes: 3 additions & 3 deletions test/pls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ end
"""
)
@test_throws(ArgumentError("initial or final parameters in io do not satisfy lowerbd"),
restoreoptsum!(m, seekstart(iob)))
@suppress restoreoptsum!(m, seekstart(iob)))

# make sure new fields are correctly restored
mktemp() do path, io
Expand All @@ -638,15 +638,15 @@ end
saveoptsum(io, m)
m.optsum.xtol_zero_abs = 1.0
m.optsum.ftol_zero_abs = 1.0
restoreoptsum!(m, seekstart(io))
@suppress restoreoptsum!(m, seekstart(io))
@test m.optsum.xtol_zero_abs == 0.5
@test m.optsum.ftol_zero_abs == 0.5
end

end

@testset "profile" begin
pr = profile(last(models(:sleepstudy)))
pr = @suppress profile(last(models(:sleepstudy)))
tbl = pr.tbl
@test length(tbl) >= 122
ci = confint(pr)
Expand Down
4 changes: 2 additions & 2 deletions test/predict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ end
slp1 = subset(slp, :days => ByRow(>(0)))
# this model probably doesn't make much sense, but it has two
# variables on the left hand side in a FunctionTerm
m = fit(MixedModel, @formula(reaction / days ~ 1 + (1|subj)), slp1)
m = @suppress fit(MixedModel, @formula(reaction / days ~ 1 + (1|subj)), slp1)
# make sure that we're getting the transformation
@test response(m) slp1.reaction ./ slp1.days
@test_throws ArgumentError predict(m, slp[:, Not(:reaction)])
Expand All @@ -154,7 +154,7 @@ end
@test predict(m, slp1) fitted(m)


m = fit(MixedModel, @formula(log10(reaction) ~ 1 + days + (1|subj)), slp1)
m = @suppress fit(MixedModel, @formula(log10(reaction) ~ 1 + days + (1|subj)), slp1)
# make sure that we're getting the transformation
@test response(m) log10.(slp1.reaction)
@test_throws ArgumentError predict(m, slp[:, Not(:reaction)])
Expand Down

2 comments on commit b551a03

@palday
Copy link
Member Author

@palday palday commented on b551a03 Jul 17, 2024

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/111233

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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 v4.25.2 -m "<description of version>" b551a03e78a3963394a250b1d52d8da480e394c5
git push origin v4.25.2

Please sign in to comment.