Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ StatsAPI = "82ae8749-77ed-4fe6-ae5f-f523153014b0"
AliasTables = "1"
DataAPI = "1"
DataStructures = "0.10, 0.11, 0.12, 0.13, 0.14, 0.17, 0.18"
JET = "0.9.18, 0.10"
LinearAlgebra = "<0.0.1, 1"
LogExpFunctions = "0.3"
Missings = "0.3, 0.4, 1.0"
Expand All @@ -35,9 +36,10 @@ julia = "1.10"
[extras]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Dates", "DelimitedFiles", "OffsetArrays", "StableRNGs", "Test"]
test = ["Dates", "DelimitedFiles", "JET", "OffsetArrays", "StableRNGs", "Test"]
4 changes: 0 additions & 4 deletions src/cov.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ end

## scatter matrix

_unscaled_covzm(x::DenseMatrix, dims::Colon) = unscaled_covzm(x)
Copy link
Member Author

Choose a reason for hiding this comment

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

There exists no unscaled_covzm with this type signature in Statistics.

_unscaled_covzm(x::DenseMatrix, dims::Integer) = unscaled_covzm(x, dims)

_unscaled_covzm(x::DenseMatrix, wv::AbstractWeights, dims::Colon) =
Copy link
Member Author

Choose a reason for hiding this comment

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

Same here.

_symmetrize!(unscaled_covzm(x, _scalevars(x, wv)))
_unscaled_covzm(x::DenseMatrix, wv::AbstractWeights, dims::Integer) =
_symmetrize!(unscaled_covzm(x, _scalevars(x, wv, dims), dims))

Expand Down
4 changes: 1 addition & 3 deletions src/deprecates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
else
function (io::typeof(stderr))(obj::StatisticalModel)
Base.depwarn("stderr(obj::StatisticalModel) is deprecated, use stderror(obj) instead", :stderr)
io === stderr ? stderror(obj) : throw(MethodErrror(io, (obj,)))
Copy link
Member Author

Choose a reason for hiding this comment

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

A typo.

io === stderr ? stderror(obj) : throw(MethodError(io, (obj,)))

Check warning on line 8 in src/deprecates.jl

View check run for this annotation

Codecov / codecov/patch

src/deprecates.jl#L8

Added line #L8 was not covered by tests
end
end

Expand All @@ -22,8 +22,6 @@
@deprecate scattermatm(x::DenseMatrix, mean, wv::AbstractWeights, dims::Int) scattermat(x, wv, mean=mean, dims=dims)
@deprecate scattermat(x::DenseMatrix, dims::Int) scattermat(x, dims=dims)
@deprecate scattermat(x::DenseMatrix, wv::AbstractWeights, dims::Int) scattermat(x, wv, dims=dims)
@deprecate scattermat_zm(x::DenseMatrix, dims::Int) scattermat_zm(x, dims=dims)
@deprecate scattermat_zm(x::DenseMatrix, wv::AbstractWeights, dims::Int) scattermat_zm(x::DenseMatrix, wv::AbstractWeights, dims=dims)
Comment on lines -25 to -26
Copy link
Member Author

Choose a reason for hiding this comment

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

Also these do not exist.

@deprecate mean!(R::AbstractArray, A::AbstractArray, w::AbstractWeights, dims::Int) mean!(R, A, w, dims=dims)
@deprecate mean(A::AbstractArray{T}, w::AbstractWeights{W}, dims::Int) where {T<:Number,W<:Real} mean(A, w, dims=dims)

Expand Down
22 changes: 22 additions & 0 deletions test/jet.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using StatsBase, Test
import JET

# JET has only experimental support for Julia 1.12 currently
# It throws an internal `AssertionError` in the tests below
if VERSION < v"1.12-"
@testset "JET" begin
# Check that there are no undefined global references and undefined field accesses
JET.test_package("StatsBase"; target_defined_modules = true, mode = :typo)

# Default error analysis for common problem fails since JET errors on interface definitions
# The (deprecated) `model_response(::StatisticalModel)` calls the interface
# function `response(::StatisticalModel)` for which no method exists yet
# Note: This analysis is not enough strict to guarantee that there are no runtime errors!
# Ref https://github.com/aviatesk/JET.jl/issues/495
res = JET.report_package("StatsBase"; target_defined_modules = true, mode = :basic, toplevel_logger = nothing)
println(res)
reports = JET.get_reports(res)
@test_broken isempty(reports)
@test length(reports) <= 1
end
end
4 changes: 3 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ tests = ["ambiguous",
"wsampling",
"statmodels",
"partialcor",
"transformations"]
"transformations",
# Test with JET after all other tests since it has side effects
"jet"]
#"statquiz"]

println("Running tests:")
Expand Down
Loading