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

Print a module that exports the name rather than the module that defines the name #25

Merged
merged 4 commits into from
Mar 3, 2024

Conversation

ericphanson
Copy link
Owner

closes #24

On this branch I get:

julia> print_explicit_imports(MixedModels)
WARNING: both Distributions and BSplineKit export "support"; uses of it in module MixedModels must be qualified
Module MixedModels is relying on implicit imports for 162 names. These could be explicitly imported as follows:

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

Additionally, module MixedModels has stale explicit imports for these unused names:
- BlasReal
- copytri!
- dataset
- datasets
- linkfun

In particular, note the

using StaticArrays: StaticArrays
using StaticArrays: SVector

and

using BSplineKit: BSplineKit
using BSplineKit: BSplineOrder
using BSplineKit: Natural
using BSplineKit: Derivative
using BSplineKit: SplineInterpolation
using BSplineKit: interpolate

which fixes the two issues @palday called out in JuliaStats/MixedModels.jl#748

@codecov-commenter
Copy link

codecov-commenter commented Mar 3, 2024

Codecov Report

Attention: Patch coverage is 91.42857% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 95.80%. Comparing base (ca9a12d) to head (827412d).

Files Patch % Lines
src/find_implicit_imports.jl 88.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
- Coverage   96.19%   95.80%   -0.39%     
==========================================
  Files           5        5              
  Lines         525      548      +23     
==========================================
+ Hits          505      525      +20     
- Misses         20       23       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ericphanson ericphanson merged commit 60f2e90 into main Mar 3, 2024
4 checks passed
@ericphanson ericphanson deleted the eph/exporting-module branch March 3, 2024 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ExplicitExports always suggests exporting from the "defining" module
2 participants