From 7678d4db758c9a867ad226cd482131f6db2c9c2a Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Tue, 13 Apr 2021 11:53:47 -0400 Subject: [PATCH] Fix CI (#612) --- .github/workflows/ci.yml | 21 +++++++++----- Project.toml | 8 ++---- .../always-loaded/neuralnetwork/flux.jl | 2 -- .../always-loaded/neuralnetwork/knet.jl | 1 - .../always-loaded/utils/constant_columns.jl | 28 ++----------------- test/Project.toml | 2 -- test/unit/toplevel/utils/constant_columns.jl | 13 --------- 7 files changed, 19 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd6840c22..e1bfcc5ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,16 +15,23 @@ jobs: CI: runs-on: ${{ matrix.os }} strategy: - matrix: - julia-version: ["1", "nightly"] - julia-arch: [x64] - os: [macos-latest, ubuntu-latest] fail-fast: false + matrix: + julia-version: + - "1.5" + - "1" + - "nightly" + arch: + - x64 + os: + - macos-latest + - ubuntu-latest steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.julia-version }} + arch: ${{ matrix.arch }} - if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update @@ -33,8 +40,8 @@ jobs: run: | brew update brew install pdf2svg tree - brew cask install basictex - echo "::add-path::/Library/TeX/texbin" + brew install --cask basictex + echo "/Library/TeX/texbin" >> $GITHUB_PATH - if: startsWith(matrix.os, 'macOS') run: | sudo tlmgr update --self || sudo tlmgr update --self || sudo tlmgr update --self @@ -44,7 +51,7 @@ jobs: - uses: julia-actions/julia-buildpkg@latest - uses: julia-actions/julia-runtest@latest env: - JULIA_DEBUG: "all" + # JULIA_DEBUG: "all" PREDICTMD_OPEN_PLOTS_DURING_TESTS: "true" PREDICTMD_TEST_GROUP: "all" PREDICTMD_TEST_PLOTS: "true" diff --git a/Project.toml b/Project.toml index b8f2f8f33..dda432b53 100644 --- a/Project.toml +++ b/Project.toml @@ -2,13 +2,11 @@ name = "PredictMD" uuid = "3e7d7328-36f8-4388-bd01-4613c92c7370" authors = ["Dilum Aluthge ", "Ishan Sinha ", "Paul Stey ", "Isabel Restrepo ", "Elizabeth Chen ", "Neil Sarkar ", "Brown Center for Biomedical Informatics "] doi = "10.5281/zenodo.1291209" -version = "0.34.19" +version = "0.34.20" [deps] -Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" CSVFiles = "5d742f6a-9f54-50ce-8119-2520741973ca" -CUDAapi = "3895d2a7-ec45-59b8-82bb-cfc6a382f9b3" Cassette = "7057c7e9-c182-5462-911a-8362d720325c" CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" ClassImbalance = "04a18a73-7590-580c-b363-eeca0919eb2a" @@ -56,10 +54,8 @@ UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228" ValueHistories = "98cad3c8-aec3-5f06-8e41-884608649ab7" [compat] -Adapt = "1" BSON = "0.2" CSVFiles = "0.16, 1.0" -CUDAapi = "2, 3, 4" Cassette = "0.2, 0.3" CategoricalArrays = "0.7, 0.8" ClassImbalance = "0.8" @@ -100,7 +96,7 @@ StatsModels = "0.6" TikzPictures = "3" UnicodePlots = "1" ValueHistories = "0.5" -julia = "1.1" +julia = "1.5" [extras] Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" diff --git a/src/toplevel/always-loaded/neuralnetwork/flux.jl b/src/toplevel/always-loaded/neuralnetwork/flux.jl index 14dd8de63..7b8dea81e 100644 --- a/src/toplevel/always-loaded/neuralnetwork/flux.jl +++ b/src/toplevel/always-loaded/neuralnetwork/flux.jl @@ -1,5 +1,3 @@ -import Adapt -import CUDAapi # import Flux # import GPUArrays # import NNlib diff --git a/src/toplevel/always-loaded/neuralnetwork/knet.jl b/src/toplevel/always-loaded/neuralnetwork/knet.jl index edb727439..71ef7a643 100644 --- a/src/toplevel/always-loaded/neuralnetwork/knet.jl +++ b/src/toplevel/always-loaded/neuralnetwork/knet.jl @@ -1,4 +1,3 @@ -import CUDAapi # import GPUArrays import Knet import ProgressMeter diff --git a/src/toplevel/always-loaded/utils/constant_columns.jl b/src/toplevel/always-loaded/utils/constant_columns.jl index 5a8364655..93e6448fa 100644 --- a/src/toplevel/always-loaded/utils/constant_columns.jl +++ b/src/toplevel/always-loaded/utils/constant_columns.jl @@ -1,24 +1,4 @@ import DataFrames -import StatsBase - -function get_countmap(itr; skip_missings::Bool = true) - if skip_missings - result = get_countmap_skip_missings(itr) - else - result = get_countmap_include_missings(itr) - end - return result -end - -function get_countmap_skip_missings(itr) - result = StatsBase.countmap(collect(skipmissing(itr))) - return result -end - -function get_countmap_include_missings(itr) - result = StatsBase.countmap(collect(itr)) - return result -end function get_unique_values(itr; skip_missings::Bool = true) if skip_missings @@ -30,13 +10,11 @@ function get_unique_values(itr; skip_missings::Bool = true) end function get_unique_values_skip_missings(itr) - result = keys(get_countmap_skip_missings(itr)) - return result + return unique(skipmissing(collect(itr))) end -function get_unique_values_include_missings(itr) - result = keys(get_countmap_include_missings(itr)) - return result +function get_unique_values_include_missings(itr) + return unique(collect(itr)) end function get_number_of_unique_values(itr; skip_missings::Bool = true)::Int diff --git a/test/Project.toml b/test/Project.toml index 49eb38daf..5a1fdb815 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,8 +1,6 @@ [deps] -Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" CSVFiles = "5d742f6a-9f54-50ce-8119-2520741973ca" -CUDAapi = "3895d2a7-ec45-59b8-82bb-cfc6a382f9b3" Cassette = "7057c7e9-c182-5462-911a-8362d720325c" CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597" ClassImbalance = "04a18a73-7590-580c-b363-eeca0919eb2a" diff --git a/test/unit/toplevel/utils/constant_columns.jl b/test/unit/toplevel/utils/constant_columns.jl index 78505df54..13592b275 100644 --- a/test/unit/toplevel/utils/constant_columns.jl +++ b/test/unit/toplevel/utils/constant_columns.jl @@ -4,19 +4,6 @@ import Test x = Union{Missing, String}["foo", "bar", "foo", missing, "bar"] -Test.@test( - length(keys(PredictMD.get_countmap(x; skip_missings = true))) == 2 - ) -Test.@test( - length(keys(PredictMD.get_countmap(x; skip_missings = false))) == 3 - ) -Test.@test( - length(keys(PredictMD.get_countmap_skip_missings(x))) == 2 - ) -Test.@test( - length(keys(PredictMD.get_countmap_include_missings(x))) == 3 - ) - Test.@test( length(PredictMD.get_unique_values(x; skip_missings = true)) == 2 )