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

Switch to explicit imports of names from packages #748

Merged
merged 8 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
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 an test (doesn't change test result) [#744]
dmbates marked this conversation as resolved.
Show resolved Hide resolved

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
8 changes: 6 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 All @@ -20,6 +20,7 @@ ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we already have StaticArrays, can we grab SVector from there? I know this doesn't increase our total dependency load, but it's another thing to track.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filed ericphanson/ExplicitImports.jl#24 fyi. I think though if you do using StaticArrays: SVector, then it won't complain about the implicit import. But when it makes suggestions, it always does the "defining" module.

Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsAPI = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Expand All @@ -36,6 +37,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.2"
GLM = "1.8.2"
InteractiveUtils = "1"
JSON3 = "1"
Expand All @@ -50,6 +52,7 @@ Random = "1"
SparseArrays = "1"
StableRNGs = "0.1, 1"
StaticArrays = "0.11, 0.12, 1"
StaticArraysCore = "1"
Statistics = "1"
StatsAPI = "1.5"
StatsBase = "0.31, 0.32, 0.33, 0.34"
Expand All @@ -65,10 +68,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"]
74 changes: 45 additions & 29 deletions src/MixedModels.jl
Original file line number Diff line number Diff line change
@@ -1,35 +1,51 @@
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
using BSplineKit.BSplines: BSplineOrder
using BSplineKit.BoundaryConditions: Natural
using BSplineKit.DifferentialOps: Derivative
using BSplineKit.SplineInterpolations: SplineInterpolation, interpolate
dmbates marked this conversation as resolved.
Show resolved Hide resolved
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
using StaticArraysCore: 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 +93,8 @@ export @formula,
condVar,
condVartables,
confint,
dataset,
datasets,
deviance,
dispersion,
dispersion_parameter,
Expand Down Expand Up @@ -190,8 +208,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: 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
Loading