diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c96f35a --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "monthly" + - package-ecosystem: "julia" + directories: # Location of Julia projects + - "/" + - "/docs" + schedule: + interval: "weekly" diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml deleted file mode 100644 index 252ef73..0000000 --- a/.github/workflows/CompatHelper.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: CompatHelper -on: - schedule: - - cron: 0 0 * * * - workflow_dispatch: -jobs: - CompatHelper: - runs-on: ubuntu-latest - steps: - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} - run: julia -e 'using CompatHelper; CompatHelper.main()' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb31859..b62b93c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,12 +24,12 @@ jobs: arch: - x64 steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v2 + - uses: actions/checkout@v7 + - uses: julia-actions/setup-julia@v3 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v1 + - uses: julia-actions/cache@v3 env: cache-name: cache-artifacts with: @@ -42,15 +42,15 @@ jobs: - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v7 with: file: lcov.info docs: name: Documentation runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v1 + - uses: actions/checkout@v7 + - uses: julia-actions/setup-julia@v3 with: version: '1' - uses: julia-actions/julia-buildpkg@v1 diff --git a/Project.toml b/Project.toml index 6b552d1..e4361fa 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MLJModelInterface" uuid = "e80e1ace-859a-464e-9ed9-23947d8ae3ea" authors = ["Thibaut Lienart and Anthony Blaom"] -version = "1.12.1" +version = "1.12.2" [deps] InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" @@ -17,12 +17,12 @@ DataFrames = "1" Distances = "0.10" InteractiveUtils = "<0.0.1, 1" Markdown = "<0.0.1, 1" -OrderedCollections = "1" +OrderedCollections = "1,2" REPL = "<0.0.1, 1" Random = "<0.0.1, 1" ScientificTypes = "3" ScientificTypesBase = "3" -StatisticalTraits = "3.5" +StatisticalTraits = "3.5, 4.0" Tables = "1" Test = "<0.0.1, 1" julia = "1.6" diff --git a/docs/Project.toml b/docs/Project.toml index 78c87ae..c249556 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,3 +1,6 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" MLJModelInterface = "e80e1ace-859a-464e-9ed9-23947d8ae3ea" + +[compat] +Documenter = "1.17.0" diff --git a/docs/src/implementing_a_data_front_end.md b/docs/src/implementing_a_data_front_end.md index 9ca214c..e64e79c 100644 --- a/docs/src/implementing_a_data_front_end.md +++ b/docs/src/implementing_a_data_front_end.md @@ -63,7 +63,7 @@ The fallback is `reformat(model, args...) = args` (i.e., slurps provided data). arguments are `reformat`ed versions of user-supplied data. For example, in the supervised case, `data_new` in `predict(model::SomeModelType, fitresult, data_new)` is - `reformat(model, Xnew)`, where `Xnew` is the data provided by the MLJ + `reformat(model, Xnew)[1]`, where `Xnew` is the data provided by the MLJ user in a call `predict(mach, Xnew)` (`mach.model == model`). - To specify how the model-specific representation of data is to be diff --git a/src/equality.jl b/src/equality.jl index 5b0ed27..91857c2 100644 --- a/src/equality.jl +++ b/src/equality.jl @@ -144,8 +144,6 @@ end # equality and a corresponding definition of `in`. Base.isequal(m1::MLJType, m2::MLJType) = (m1 === m2) -# Note: To prevent julia crash, it seems we need to annotate the type -# of itr: function special_in(x, itr)::Union{Bool,Missing} for y in itr ismissing(y) && return missing @@ -154,9 +152,12 @@ function special_in(x, itr)::Union{Bool,Missing} return false end +# Note: To address some method ambiguities, it seems we need to annotate +# the type of itr: Base.in(x::MLJType, itr::Set) = special_in(x, itr) Base.in(x::MLJType, itr::AbstractVector{<:MLJType}) = special_in(x, itr) Base.in(x::MLJType, itr::AbstractRange{<:MLJType}) = special_in(x, itr) +Base.in(x::MLJType, itr::Base.ReshapedArray{<:MLJType,1}) = special_in(x, itr) Base.in(x::MLJType, itr::Tuple) = special_in(x, itr) Base.in(x::MLJType, itr::Tuple{(Any for _ in 1:32)..., Vararg{Any}}) = special_in(x, itr)