From 7b38f388c99baf1e3489871b7a9284eb3ff8208a Mon Sep 17 00:00:00 2001 From: Phillip Alday Date: Wed, 5 Apr 2023 14:50:55 +0000 Subject: [PATCH] Compat for StatsModels 0.7 (#26) * add StatsModels 0.7 to compat list * fix deprecation warning * test both StatsModels 0.6 and 0.7 * version bump * bump min julia compat * only test on x64 --- .github/workflows/CI.yml | 25 ++++++++++++------------- Project.toml | 6 +++--- test/scaling.jl | 3 ++- test/zscoring.jl | 3 ++- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 92b2f46..ed1352f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -7,36 +7,35 @@ on: pull_request: jobs: test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + name: Julia ${{ matrix.version }} - StatsModels ${{ matrix.statsmodels }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: version: - '1' - - '1.0' + - '1.6' - 'nightly' + statsmodels: + - '0.6' + - '0.7' os: - ubuntu-latest arch: - x64 - - x86 + # - x86 steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v1 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - name: "Install StatsModels" + shell: julia --color=yes --project {0} + run: | + using Pkg + Pkg.add(Pkg.PackageSpec(; name="StatsModels", version="${{ matrix.statsmodels }}")) + - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 diff --git a/Project.toml b/Project.toml index bac688f..6d958ab 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "StandardizedPredictors" uuid = "5064a6a7-f8c2-40e2-8bdc-797ec6f1ae18" authors = "Beacon Biosignals, inc." -version = "0.1.4" +version = "0.1.5" [deps] Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" @@ -10,8 +10,8 @@ StatsModels = "3eaba693-59b7-5ba5-a881-562e759f1c8d" [compat] StatsBase = "0.33" -StatsModels = "0.6" -julia = "1" +StatsModels = "0.6, 0.7" +julia = "1.6" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/test/scaling.jl b/test/scaling.jl index fdc9d06..c5f1216 100644 --- a/test/scaling.jl +++ b/test/scaling.jl @@ -15,7 +15,8 @@ @test modelcols(yc, data) == data.y ./ std(data.y) == data.y ./ yc.scale @testset "alternative scale function" begin - f = mad + # default normalize will change in a future release of StatsBase + f = x -> mad(x; normalize=true) xc = concrete_term(term(:x), data, Scale(f)) @test xc isa ScaledTerm @test xc.scale == f(data.x) diff --git a/test/zscoring.jl b/test/zscoring.jl index 8d6b77a..3f785cc 100644 --- a/test/zscoring.jl +++ b/test/zscoring.jl @@ -16,7 +16,8 @@ @test modelcols(yc, data) ≈ zscore(data.y) ≈ zscore(data.y, yc.center, yc.scale) @testset "alternative center and scale functions" begin - f, g = first, mad + # default normalize will change in a future release of StatsBase + f, g = first, x -> mad(x; normalize=true) xc = concrete_term(term(:x), data, ZScore(f, g)) @test xc isa ZScoredTerm @test xc.center ≈ f(data.x)