From d1e7530cf58f3aa185c11fc8e5edc97e48fb322d Mon Sep 17 00:00:00 2001 From: jishnub Date: Sun, 20 Jun 2021 14:13:45 +0400 Subject: [PATCH 1/4] limit type-piracy in getindex --- Project.toml | 4 +++- src/OffsetArrays.jl | 2 +- test/runtests.jl | 10 ++++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index 6490cf3c..b0aa3538 100644 --- a/Project.toml +++ b/Project.toml @@ -8,6 +8,7 @@ Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" [compat] Adapt = "2, 3" Aqua = "0.5" +ArrayInterface = "3" CatIndices = "0.2" DistributedArrays = "0.6" Documenter = "0.26" @@ -18,6 +19,7 @@ julia = "0.7, 1" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" +ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" CatIndices = "aafaddc9-749c-510e-ac4f-586e18779b91" DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" DistributedArrays = "aaf54ef3-cdf8-58ed-94cc-d582ad619b94" @@ -29,4 +31,4 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["Aqua", "CatIndices", "DistributedArrays", "DelimitedFiles", "Documenter", "Test", "LinearAlgebra", "EllipsisNotation", "StaticArrays", "FillArrays"] +test = ["ArrayInterface", "Aqua", "CatIndices", "DistributedArrays", "DelimitedFiles", "Documenter", "Test", "LinearAlgebra", "EllipsisNotation", "StaticArrays", "FillArrays"] diff --git a/src/OffsetArrays.jl b/src/OffsetArrays.jl index c9563867..ffaa1e53 100644 --- a/src/OffsetArrays.jl +++ b/src/OffsetArrays.jl @@ -509,7 +509,7 @@ end @inline _boundscheck_return(r, s) = (@boundscheck checkbounds(r, s); s) for OR in [:IIUR, :IdOffsetRange] - for R in [:StepRange, :StepRangeLen, :LinRange, :AbstractUnitRange] + for R in [:StepRange, :StepRangeLen, :LinRange, :UnitRange, :(Base.OneTo)] @eval @inline Base.getindex(r::$R, s::$OR) = _boundscheck_index_retaining_axes(r, s) end diff --git a/test/runtests.jl b/test/runtests.jl index 4ba44875..a0cb75b5 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -39,6 +39,14 @@ function same_value(r1, r2) return true end +module AmbiguityTest + using Test + using ArrayInterface + using OffsetArrays + using Aqua + Aqua.test_ambiguities([OffsetArrays, ArrayInterface]) +end + @testset "Project meta quality checks" begin # Not checking compat section for test-only dependencies Aqua.test_all(OffsetArrays; project_extras=true, deps_compat=true, stale_deps=true, project_toml_formatting=true) @@ -1083,7 +1091,6 @@ end Base.OneTo(1000), CustomRange(Base.OneTo(1000)), Slice(Base.OneTo(1000)), - SOneTo(1000), 1:1000, UnitRange(1.0, 1000.0), 1:3:1000, @@ -1228,7 +1235,6 @@ end # AbstractRanges Base.OneTo(1000), Slice(Base.OneTo(1000)), - SOneTo(1000), CustomRange(Base.OneTo(1000)), 1:1000, UnitRange(1.0, 1000.0), From dfd0904200b3206ef3c87ea3355bb980ff7145c8 Mon Sep 17 00:00:00 2001 From: jishnub Date: Wed, 23 Jun 2021 11:51:28 +0400 Subject: [PATCH 2/4] remove tests with ArrayInterface --- Project.toml | 4 +--- test/runtests.jl | 8 -------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/Project.toml b/Project.toml index b0aa3538..6490cf3c 100644 --- a/Project.toml +++ b/Project.toml @@ -8,7 +8,6 @@ Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" [compat] Adapt = "2, 3" Aqua = "0.5" -ArrayInterface = "3" CatIndices = "0.2" DistributedArrays = "0.6" Documenter = "0.26" @@ -19,7 +18,6 @@ julia = "0.7, 1" [extras] Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" -ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" CatIndices = "aafaddc9-749c-510e-ac4f-586e18779b91" DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab" DistributedArrays = "aaf54ef3-cdf8-58ed-94cc-d582ad619b94" @@ -31,4 +29,4 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] -test = ["ArrayInterface", "Aqua", "CatIndices", "DistributedArrays", "DelimitedFiles", "Documenter", "Test", "LinearAlgebra", "EllipsisNotation", "StaticArrays", "FillArrays"] +test = ["Aqua", "CatIndices", "DistributedArrays", "DelimitedFiles", "Documenter", "Test", "LinearAlgebra", "EllipsisNotation", "StaticArrays", "FillArrays"] diff --git a/test/runtests.jl b/test/runtests.jl index a0cb75b5..fe754a57 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -39,14 +39,6 @@ function same_value(r1, r2) return true end -module AmbiguityTest - using Test - using ArrayInterface - using OffsetArrays - using Aqua - Aqua.test_ambiguities([OffsetArrays, ArrayInterface]) -end - @testset "Project meta quality checks" begin # Not checking compat section for test-only dependencies Aqua.test_all(OffsetArrays; project_extras=true, deps_compat=true, stale_deps=true, project_toml_formatting=true) From f07be997f3dfbb5f832801863a771636e90d7c6f Mon Sep 17 00:00:00 2001 From: jishnub Date: Sun, 27 Jun 2021 23:45:15 +0400 Subject: [PATCH 3/4] version bump to v1.11.0 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 6490cf3c..4e18dae1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "OffsetArrays" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.10.0" +version = "1.11.0" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" From a64e98a5814cebad3e09628a1c2c213672f5d748 Mon Sep 17 00:00:00 2001 From: jishnub Date: Tue, 29 Jun 2021 11:15:28 +0400 Subject: [PATCH 4/4] version bump to v1.10.1 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 4e18dae1..4ea4fb5c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "OffsetArrays" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" -version = "1.11.0" +version = "1.10.1" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"