Skip to content

Commit

Permalink
Adjust compat settings and progress named argument (#84)
Browse files Browse the repository at this point in the history
* Allow recent Makie and BSplineKit. Use size arg.

* Use `progress` named argument.

* Allow later version of `CairoMakie` in docs build.

* Add color named arg as requested by @palday.

* patch bump
  • Loading branch information
dmbates authored Jan 10, 2024
1 parent c8b45f0 commit 772c89c
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 22 deletions.
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MixedModelsMakie"
uuid = "b12ae82c-6730-437f-aff9-d2c38332a376"
authors = ["Phillip Alday <[email protected]>", "Douglas Bates <[email protected]>", "contributors"]
version = "0.3.28"
version = "0.3.29"

[deps]
BSplineKit = "093aae92-e908-43d7-9660-e50ee39d5a0a"
Expand All @@ -17,11 +17,11 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"

[compat]
BSplineKit = "0.14, 0.15, 0.16"
BSplineKit = "0.15, 0.16, 0.17"
DataFrames = "1"
Distributions = "0.21, 0.22, 0.23, 0.24, 0.25"
KernelDensity = "0.6.3"
Makie = "0.18,0.19"
Makie = "0.20"
MixedModels = "4.14"
PrecompileTools = "1"
SpecialFunctions = "1, 2"
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ MixedModelsMakie = "b12ae82c-6730-437f-aff9-d2c38332a376"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
CairoMakie = "0.6 - 0.10"
CairoMakie = "0.6 - 0.11"
DataFrames = "1"
Documenter = "0.27"
16 changes: 8 additions & 8 deletions docs/src/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ gm0 = fit(MixedModel,
subjre = ranefinfo(fm1)[:subj]
caterpillar!(Figure(; resolution=(800,600)), subjre)
caterpillar!(Figure(; size=(800,600)), subjre)
```

```@example Caterpillar
caterpillar!(Figure(; resolution=(800,600)), subjre; orderby=2)
caterpillar!(Figure(; size=(800,600)), subjre; orderby=2)
```

```@example Caterpillar
caterpillar!(Figure(; resolution=(800,600)), subjre; orderby=nothing)
caterpillar!(Figure(; size=(800,600)), subjre; orderby=nothing)
```

```@example Caterpillar
Expand All @@ -129,11 +129,11 @@ qqcaterpillar(gm0, :item)
```

```@example Caterpillar
qqcaterpillar!(Figure(; resolution=(400,300)), subjre; cols=[1])
qqcaterpillar!(Figure(; size=(400,300)), subjre; cols=[1])
```

```@example Caterpillar
qqcaterpillar!(Figure(; resolution=(400,300)), subjre; cols=[:days])
qqcaterpillar!(Figure(; size=(400,300)), subjre; cols=[:days])
```

### Shrinkage Plots
Expand All @@ -159,7 +159,7 @@ shrinkageplot(fm1; ellipse=true)
```

```@example Shrinkage
shrinkageplot!(Figure(; resolution=(400,400)), fm1)
shrinkageplot!(Figure(; size=(400,400)), fm1)
```

```@example Shrinkage
Expand Down Expand Up @@ -261,7 +261,7 @@ data = rmul!(randn(100, 3), LowerTriangular([+1 +0 +0;
-1 -1 +1]))
df = DataFrame(data, [:x, :y, :z])
splom!(Figure(; resolution=(800, 800)), df)
splom!(Figure(; size=(800, 800)), df)
```

Meanwhile, `splomaxes!` provides a lower-level backend for `splom!`
Expand All @@ -286,6 +286,6 @@ function pfunc(ax, i, j)
text!(ax, "r=$(cc)")
return ax
end
splomaxes!(Figure(; resolution=(800, 800)),
splomaxes!(Figure(; size=(800, 800)),
names(df), pfunc)
```
4 changes: 2 additions & 2 deletions src/caterpillar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ of the random effects.
`kwargs...` are passed on to [`caterpillar!`](@ref).
"""
function caterpillar(m::MixedModel, gf::Symbol=first(fnames(m)); kwargs...)
return caterpillar!(Figure(; resolution=(1000, 800)), m, gf; kwargs...)
return caterpillar!(Figure(; size=(1000, 800)), m, gf; kwargs...)
end

"""
Expand Down Expand Up @@ -222,7 +222,7 @@ Returns a `Figure` of a "qq-caterpillar plot" of the random-effects means and pr
`kwargs...` are passed on to [`qqcaterpillar!`](@ref).
"""
function qqcaterpillar(m::MixedModel, gf::Symbol=first(fnames(m)); kwargs...)
return qqcaterpillar!(Figure(; resolution=(1000, 800)), m, gf; kwargs...)
return qqcaterpillar!(Figure(; size=(1000, 800)), m, gf; kwargs...)
end

_cols_to_idx(::Vector{String}, cols) = cols
Expand Down
2 changes: 1 addition & 1 deletion src/coefplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function coefplot(x::Union{MixedModel,MixedModelBootstrap};
show_intercept=true,
attributes...)
# need to guarantee a min height of 150
fig = Figure(; resolution=(640, max(150, 75 * _npreds(x; show_intercept))))
fig = Figure(; size=(640, max(150, 75 * _npreds(x; show_intercept))))
ax = Axis(fig[1, 1])
pl = coefplot!(ax, x; conf_level, vline_at_zero, show_intercept, attributes...)
return Makie.FigureAxisPlot(fig, ax, pl)
Expand Down
2 changes: 1 addition & 1 deletion src/profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function zetatraces!(ax::Axis, pr::MixedModelProfile, i, j)
return ax
end
function zetatraceplot(pr::MixedModelProfile; figure=(; resolution=(800,800)))
function zetatraceplot(pr::MixedModelProfile; figure=(; size=(800,800)))
(; fecnames) = pr
f = Figure(; figure)
p = length(fecnames)
Expand Down
5 changes: 3 additions & 2 deletions src/ridge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ function ridgeplot(x::MixedModelBootstrap;
show_intercept=true,
attributes...)
# need to guarantee a min height of 200
fig = Figure(; resolution=(640, max(200, 100 * _npreds(x; show_intercept))))
fig = Figure(; size=(640, max(200, 100 * _npreds(x; show_intercept))))
ax = Axis(fig[1, 1])
if !ismissing(conf_level)
pl = coefplot!(ax, x; conf_level, vline_at_zero, show_intercept, attributes...)
pl = coefplot!(ax, x; conf_level, vline_at_zero, show_intercept, color=:black,
attributes...)
end
pl = ridgeplot!(ax, x; vline_at_zero, conf_level, show_intercept, attributes...)
return Makie.FigureAxisPlot(fig, ax, pl)
Expand Down
2 changes: 1 addition & 1 deletion src/ridge2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ end

"""$(@doc ridge2d!)"""
function ridge2d(bs::MixedModelBootstrap, args...; kwargs...)
f = Figure(; resolution=(1000, 1000)) # use an aspect ratio of 1 for the whole figure
f = Figure(; size=(1000, 1000)) # use an aspect ratio of 1 for the whole figure

return ridge2d!(f, bs, args...; kwargs...)
end
2 changes: 1 addition & 1 deletion src/shrinkage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ conditional means can be regarded as unpenalized.
`args...` and `kwargs...` are passed on to [`shrinkageplot!`](@ref)
"""
function shrinkageplot(m::MixedModel, args...; kwargs...)
f = Figure(; resolution=(1000, 1000)) # use an aspect ratio of 1 for the whole figure
f = Figure(; size=(1000, 1000)) # use an aspect ratio of 1 for the whole figure

return shrinkageplot!(f, m, args...; kwargs...)
end
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ g1 = fit(MixedModel,
f = qqcaterpillar(g1)
save(joinpath(OUTDIR, "qqcat_verbagg.png"), f)

let f = Figure(; resolution=(1000, 600))
let f = Figure(; size=(1000, 600))
gl = f[1, 1] = GridLayout()
re = ranefinfo(m2)
qqcaterpillar!(gl, re[:item])
Expand Down
2 changes: 1 addition & 1 deletion test/utils_and_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ m1 = fit(MixedModel,

@testset "confint_table" begin
wald = confint_table(m1, 0.68)
bsamp = parametricbootstrap(MersenneTwister(42), 1000, m1; hide_progress=!progress)
bsamp = parametricbootstrap(MersenneTwister(42), 1000, m1; progress)
boot = confint_table(bsamp, 0.68)

@test wald.coefname == boot.coefname
Expand Down

2 comments on commit 772c89c

@palday
Copy link
Owner

@palday palday commented on 772c89c Jan 10, 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/98668

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 v0.3.29 -m "<description of version>" 772c89c6b7595b51031c7c0ecfd8ad77cac87c16
git push origin v0.3.29

Also, note the warning: Version 0.3.29 skips over 0.3.28
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

Please sign in to comment.