From 666e942abc909f788ed721393351c2f3219e8b94 Mon Sep 17 00:00:00 2001 From: hyrodium Date: Wed, 30 Mar 2022 23:42:51 +0900 Subject: [PATCH 1/5] drop support for Julia 0.7 --- .github/workflows/CI.yml | 1 - Project.toml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 478d850..8d43117 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,7 +13,6 @@ jobs: fail-fast: false matrix: version: - - '0.7' - '1.0' - '1' # - 'nightly' diff --git a/Project.toml b/Project.toml index d06f201..daa4d7a 100644 --- a/Project.toml +++ b/Project.toml @@ -9,7 +9,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] EllipsisNotation = "0.4, 1.0" -julia = "0.7, 1" +julia = "1" [extras] OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" From 1ba62dfb8631b5f2826e050bff3165bcb1cfae82 Mon Sep 17 00:00:00 2001 From: hyrodium Date: Wed, 30 Mar 2022 23:43:22 +0900 Subject: [PATCH 2/5] add Julia 1.6 in CI.yml --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8d43117..07266be 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -14,6 +14,7 @@ jobs: matrix: version: - '1.0' + - '1.6' - '1' # - 'nightly' os: From a9723b1c20a9dca425fdb71e59d2ee801e2089e2 Mon Sep 17 00:00:00 2001 From: hyrodium Date: Thu, 31 Mar 2022 00:27:32 +0900 Subject: [PATCH 3/5] bump version to 0.6.0 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index daa4d7a..2df41f5 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "IntervalSets" uuid = "8197267c-284f-5f27-9208-e0e47529a953" -version = "0.5.4" +version = "0.6.0" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" From 6efd4ab65aaa5cf47f7f754697f539d3b75dbced Mon Sep 17 00:00:00 2001 From: hyrodium Date: Thu, 31 Mar 2022 00:29:09 +0900 Subject: [PATCH 4/5] remove deprecated methods --- src/IntervalSets.jl | 47 --------------------------------------------- src/interval.jl | 4 ---- 2 files changed, 51 deletions(-) diff --git a/src/IntervalSets.jl b/src/IntervalSets.jl index 3f2b0e6..3947bb8 100644 --- a/src/IntervalSets.jl +++ b/src/IntervalSets.jl @@ -65,9 +65,6 @@ isclosedset(d::AbstractInterval) = isleftclosed(d) && isrightclosed(d) "Is the interval open?" isopenset(d::AbstractInterval) = isleftopen(d) && isrightopen(d) -@deprecate isopen(d) isopenset(d) false -@deprecate isclosed(d) isclosedset(d) - eltype(::Type{AbstractInterval{T}}) where {T} = T @pure eltype(::Type{I}) where {I<:AbstractInterval} = eltype(supertype(I)) @@ -137,50 +134,6 @@ in(::Missing, I::TypedEndpointsInterval{:open,:open}) = !isempty(I) && missing in(::Missing, I::TypedEndpointsInterval{:closed,:open}) = !isempty(I) && missing in(::Missing, I::TypedEndpointsInterval{:open,:closed}) = !isempty(I) && missing -# The code below can be defined as -# ``` -# function in(a::AbstractInterval, b::AbstractInterval) -# Base.depwarn("`in(a::AbstractInterval, b::AbstractInterval)` (equivalently, `a ∈ b`) is deprecated in favor of `issubset(a, b)` (equivalently, `a ⊆ b`). Note that the behavior for empty intervals is also changing.", :in) -# return in_deprecation(a, b) -# end -# ``` -# but that makes ambiguity definition. -function in(a::AbstractInterval, b::TypedEndpointsInterval{:closed,:closed}) - Base.depwarn("`in(a::AbstractInterval, b::AbstractInterval)` (equivalently, `a ∈ b`) is deprecated in favor of `issubset(a, b)` (equivalently, `a ⊆ b`). Note that the behavior for empty intervals is also changing.", :in) - return in_deprecation(a, b) -end -function in(a::AbstractInterval, b::TypedEndpointsInterval{:open,:open}) - Base.depwarn("`in(a::AbstractInterval, b::AbstractInterval)` (equivalently, `a ∈ b`) is deprecated in favor of `issubset(a, b)` (equivalently, `a ⊆ b`). Note that the behavior for empty intervals is also changing.", :in) - return in_deprecation(a, b) -end -function in(a::AbstractInterval, b::TypedEndpointsInterval{:closed,:open}) - Base.depwarn("`in(a::AbstractInterval, b::AbstractInterval)` (equivalently, `a ∈ b`) is deprecated in favor of `issubset(a, b)` (equivalently, `a ⊆ b`). Note that the behavior for empty intervals is also changing.", :in) - return in_deprecation(a, b) -end -function in(a::AbstractInterval, b::TypedEndpointsInterval{:open,:closed}) - Base.depwarn("`in(a::AbstractInterval, b::AbstractInterval)` (equivalently, `a ∈ b`) is deprecated in favor of `issubset(a, b)` (equivalently, `a ⊆ b`). Note that the behavior for empty intervals is also changing.", :in) - return in_deprecation(a, b) -end - -in_deprecation(a::AbstractInterval, b::TypedEndpointsInterval{:closed,:closed}) = - (leftendpoint(a) ≥ leftendpoint(b)) & (rightendpoint(a) ≤ rightendpoint(b)) -in_deprecation(a::TypedEndpointsInterval{:open,:open}, b::TypedEndpointsInterval{:open,:open} ) = - (leftendpoint(a) ≥ leftendpoint(b)) & (rightendpoint(a) ≤ rightendpoint(b)) -in_deprecation(a::TypedEndpointsInterval{:closed,:open}, b::TypedEndpointsInterval{:open,:open} ) = - (leftendpoint(a) > leftendpoint(b)) & (rightendpoint(a) ≤ rightendpoint(b)) -in_deprecation(a::TypedEndpointsInterval{:open,:closed}, b::TypedEndpointsInterval{:open,:open} ) = - (leftendpoint(a) ≥ leftendpoint(b)) & (rightendpoint(a) < rightendpoint(b)) -in_deprecation(a::TypedEndpointsInterval{:closed,:closed}, b::TypedEndpointsInterval{:open,:open} ) = - (leftendpoint(a) > leftendpoint(b)) & (rightendpoint(a) < rightendpoint(b)) -in_deprecation(a::TypedEndpointsInterval{:closed}, b::TypedEndpointsInterval{:open,:closed} ) = - (leftendpoint(a) > leftendpoint(b)) & (rightendpoint(a) ≤ rightendpoint(b)) -in_deprecation(a::TypedEndpointsInterval{:open}, b::TypedEndpointsInterval{:open,:closed} ) = - (leftendpoint(a) ≥ leftendpoint(b)) & (rightendpoint(a) ≤ rightendpoint(b)) -in_deprecation(a::TypedEndpointsInterval{L,:closed}, b::TypedEndpointsInterval{:closed,:open}) where L = - (leftendpoint(a) ≥ leftendpoint(b)) & (rightendpoint(a) < rightendpoint(b)) -in_deprecation(a::TypedEndpointsInterval{L,:open}, b::TypedEndpointsInterval{:closed,:open}) where L = - (leftendpoint(a) ≥ leftendpoint(b)) & (rightendpoint(a) ≤ rightendpoint(b)) - isempty(A::TypedEndpointsInterval{:closed,:closed}) = leftendpoint(A) > rightendpoint(A) isempty(A::TypedEndpointsInterval) = leftendpoint(A) ≥ rightendpoint(A) diff --git a/src/interval.jl b/src/interval.jl index ad280eb..e0ce03e 100644 --- a/src/interval.jl +++ b/src/interval.jl @@ -233,7 +233,3 @@ ClosedInterval(i::AbstractUnitRange{I}) where {I<:Integer} = ClosedInterval{I}(m Base.promote_rule(::Type{Interval{L,R,T1}}, ::Type{Interval{L,R,T2}}) where {L,R,T1,T2} = Interval{L,R,promote_type(T1, T2)} - -# convert should only work if they represent the same thing. -@deprecate convert(::Type{R}, i::ClosedInterval{I}) where {R<:AbstractUnitRange,I<:Integer} R(i) -@deprecate length(i::ClosedInterval) IntervalSets.duration(i) From 362a5893bea526b3f0efaa24c2e7512d8969b084 Mon Sep 17 00:00:00 2001 From: hyrodium Date: Thu, 31 Mar 2022 00:53:09 +0900 Subject: [PATCH 5/5] drop support under Julia 1.6 --- .github/workflows/CI.yml | 1 - Project.toml | 2 +- src/IntervalSets.jl | 3 --- test/findall.jl | 4 +--- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 07266be..57d04af 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,7 +13,6 @@ jobs: fail-fast: false matrix: version: - - '1.0' - '1.6' - '1' # - 'nightly' diff --git a/Project.toml b/Project.toml index fc804ac..139c97c 100644 --- a/Project.toml +++ b/Project.toml @@ -7,7 +7,7 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] -julia = "1" +julia = "1.6" [extras] OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" diff --git a/src/IntervalSets.jl b/src/IntervalSets.jl index b931e26..f049519 100644 --- a/src/IntervalSets.jl +++ b/src/IntervalSets.jl @@ -164,9 +164,6 @@ end ⊇(A::AbstractInterval, B::AbstractInterval) = issubset(B, A) ⊊(A::AbstractInterval, B::AbstractInterval) = (A ≠ B) & (A ⊆ B) ⊋(A::AbstractInterval, B::AbstractInterval) = (A ≠ B) & (A ⊇ B) -if VERSION < v"1.1.0-DEV.123" - issubset(x, B::AbstractInterval) = issubset(convert(AbstractInterval, x), B) -end const _interval_hash = UInt == UInt64 ? 0x1588c274e0a33ad4 : 0x1e3f7252 diff --git a/test/findall.jl b/test/findall.jl index b2a1df9..e9fbb6c 100644 --- a/test/findall.jl +++ b/test/findall.jl @@ -139,13 +139,11 @@ end (-2u"m":0.1u"m":1u"m", -1.05u"m"..1u"km"), (-2u"m":0.1u"m":1u"m", -4u"m"..1u"km"), (-2u"m":0.1u"m":1u"m", -4.05u"m"..1u"km"), - ]; - VERSION >= v"1.4" ? [ (Date(2021, 1, 1):Day(1):Date(2021, 3, 1), Date(2020, 1, 11)..Date(2020, 2, 22)), (Date(2021, 1, 1):Day(1):Date(2021, 3, 1), Date(2021, 1, 11)..Date(2021, 2, 22)), (DateTime(2021, 1, 1):Millisecond(10000):DateTime(2021, 3, 1), DateTime(2020, 1, 11)..DateTime(2020, 2, 22)), (DateTime(2021, 1, 1):Millisecond(10000):DateTime(2021, 3, 1), DateTime(2021, 1, 11)..DateTime(2021, 2, 22)), - ] : []; + ] ] assert_in_interval(x, interval) assert_in_interval(reverse(x), interval)