Skip to content

Commit

Permalink
Merge branch 'main' into pa/fma
Browse files Browse the repository at this point in the history
  • Loading branch information
palday authored Mar 5, 2024
2 parents d0f24f9 + ee5f2cf commit 6ca5832
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 32 deletions.
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
MixedModels v4.22.4 Release Notes
==============================
* Switch to explicit imports from all included packages (i.e. replace `using Foo` by `using Foo: Foo, bar, baz`) [#748]
* Reset parameter values before a `deepcopy` in a test (doesn't change test result) [#744]

MixedModels v4.22.3 Release Notes
==============================
* Comment out calls to `@debug` [#733]
Expand Down Expand Up @@ -490,3 +495,5 @@ Package dependencies
[#715]: https://github.com/JuliaStats/MixedModels.jl/issues/715
[#717]: https://github.com/JuliaStats/MixedModels.jl/issues/717
[#733]: https://github.com/JuliaStats/MixedModels.jl/issues/733
[#744]: https://github.com/JuliaStats/MixedModels.jl/issues/744
[#748]: https://github.com/JuliaStats/MixedModels.jl/issues/748
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MixedModels"
uuid = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316"
author = ["Phillip Alday <[email protected]>", "Douglas Bates <[email protected]>", "Jose Bayoan Santiago Calderon <[email protected]>"]
version = "4.22.3"
version = "4.22.4"

[deps]
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"
Expand Down Expand Up @@ -36,6 +36,7 @@ BSplineKit = "0.14, 0.15, 0.16, 0.17"
DataAPI = "1"
DataFrames = "1"
Distributions = "0.21, 0.22, 0.23, 0.24, 0.25"
ExplicitImports = "1.3"
GLM = "1.8.2"
InteractiveUtils = "1"
JSON3 = "1"
Expand Down Expand Up @@ -65,10 +66,11 @@ julia = "1.8"
[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "DataFrames", "InteractiveUtils", "StableRNGs", "Suppressor", "Test"]
test = ["Aqua", "DataFrames", "ExplicitImports", "InteractiveUtils", "StableRNGs", "Suppressor", "Test"]
70 changes: 41 additions & 29 deletions src/MixedModels.jl
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
module MixedModels

using Arrow
using BSplineKit
using DataAPI
using Distributions
using GLM
using JSON3
using LinearAlgebra
using Markdown
using NLopt
using Random
using PooledArrays
using ProgressMeter
using SparseArrays
using StaticArrays
using Statistics
using StatsAPI
using StatsBase
using StatsModels
using StructTypes
using Tables
using TypedTables

using LinearAlgebra: BlasFloat, BlasReal, HermOrSym, PosDefException, copytri!
using Arrow: Arrow
using Base: Ryu, require_one_based_indexing
using DataAPI: levels, refpool, refarray, refvalue
using GLM: Link, canonicallink, linkfun, linkinv, dispersion, dispersion_parameter
using BSplineKit: BSplineKit, BSplineOrder, Natural, Derivative, SplineInterpolation
using BSplineKit: interpolate
using DataAPI: DataAPI, levels, refpool, refarray, refvalue
using Distributions: Distributions, Bernoulli, Binomial, Chisq, Distribution, Gamma
using Distributions: InverseGaussian, Normal, Poisson, ccdf, estimate
using GLM: GLM, GeneralizedLinearModel, IdentityLink, InverseLink, LinearModel
using GLM: Link, LogLink, LogitLink, ProbitLink, SqrtLink
using GLM: canonicallink, glm, linkinv, dispersion, dispersion_parameter
using JSON3: JSON3
using LinearAlgebra: LinearAlgebra, Adjoint, BLAS, BlasFloat, ColumnNorm
using LinearAlgebra: Diagonal, Hermitian, HermOrSym, I, LAPACK, LowerTriangular
using LinearAlgebra: PosDefException, SVD, SymTridiagonal, Symmetric
using LinearAlgebra: UpperTriangular, cond, diag, diagind, dot, eigen, isdiag
using LinearAlgebra: ldiv!, lmul!, logdet, mul!, norm, normalize, normalize!, qr
using LinearAlgebra: rank, rdiv!, rmul!, svd, tr, tril!
using Markdown: Markdown
using MixedModelsDatasets: dataset, datasets
using NLopt: Opt
using StatsModels: TableRegressionModel
using NLopt: NLopt, Opt, ftol_abs, ftol_rel, initial_step, maxtime, xtol_abs, xtol_rel
using PooledArrays: PooledArrays, PooledArray
using PrecompileTools: PrecompileTools, @setup_workload, @compile_workload
using ProgressMeter: ProgressMeter, Progress, ProgressUnknown, finish!, next!
using Random: Random, AbstractRNG, randn!
using SparseArrays: SparseArrays, SparseMatrixCSC, SparseVector, dropzeros!, nnz
using SparseArrays: nonzeros, nzrange, rowvals, sparse
using StaticArrays: StaticArrays, SVector
using Statistics: Statistics, mean, quantile, std
using StatsAPI: StatsAPI, aic, aicc, bic, coef, coefnames, coeftable, confint, deviance
using StatsAPI: dof, dof_residual, fit, fit!, fitted, isfitted, islinear, leverage
using StatsAPI: loglikelihood, meanresponse, modelmatrix, nobs, predict, r2, residuals
using StatsAPI: response, responsename, stderror, vcov, weights
using StatsBase: StatsBase, CoefTable, model_response, summarystats
using StatsFuns: log2π, normccdf
using StatsModels: StatsModels, AbstractContrasts, AbstractTerm, CategoricalTerm
using StatsModels: ConstantTerm, DummyCoding, EffectsCoding, FormulaTerm, FunctionTerm
using StatsModels: HelmertCoding, HypothesisCoding, InteractionTerm, InterceptTerm
using StatsModels: MatrixTerm, SeqDiffCoding, TableRegressionModel, Term
using StatsModels: apply_schema, drop_term, formula, modelcols, term, @formula
using StructTypes: StructTypes
using Tables: Tables, columntable, rows
using TypedTables: TypedTables, DictTable, FlexTable, Table

export @formula,
AbstractReMat,
Expand Down Expand Up @@ -77,6 +89,8 @@ export @formula,
condVar,
condVartables,
confint,
dataset,
datasets,
deviance,
dispersion,
dispersion_parameter,
Expand Down Expand Up @@ -190,8 +204,6 @@ include("mimeshow.jl")
include("serialization.jl")
include("profile/profile.jl")

using PrecompileTools

@setup_workload begin
# Putting some things in `setup` can reduce the size of the
# precompile file and potentially make loading faster.
Expand Down
6 changes: 5 additions & 1 deletion test/matrixterm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ end
@test typeof(X.x) <: SparseMatrixCSC
@test X.rank == 28
@test X.cnames == fe.cnames
m1 = fit!(LinearMixedModel(collect(m.y), X, deepcopy(m.reterms), m.formula); progress=false)
m1 = LinearMixedModel(collect(m.y), X, deepcopy(m.reterms), m.formula)
# because of the way the initial values are calculated
# m1.optsum.initial == m.optsum.final at this point
copyto!(m1.optsum.initial, m.optsum.initial)
fit!(m1; progress=false)
@test isapprox(m1.θ, m.θ, rtol = 1.0e-5)
end

Expand Down
6 changes: 6 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Aqua
using ExplicitImports
using GLM
using MixedModels
using Test
Expand All @@ -18,6 +19,11 @@ import LinearAlgebra: BLAS
piracies=(;treat_as_own=[GLM.wrkresp!, Base.:|]))
end

@testset "ExplicitImports" begin
@test check_no_implicit_imports(MixedModels) === nothing
@test check_no_stale_explicit_imports(MixedModels) === nothing
end

include("utilities.jl")
include("misc.jl")
include("pivot.jl")
Expand Down

0 comments on commit 6ca5832

Please sign in to comment.