Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Julia 0.7 #92

Merged
merged 6 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ jobs:
fail-fast: false
matrix:
version:
- '0.7'
- '1.0'
- '1.6'
- '1'
# - 'nightly'
os:
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "IntervalSets"
uuid = "8197267c-284f-5f27-9208-e0e47529a953"
version = "0.5.4"
version = "0.6.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"

[compat]
julia = "0.7, 1"
julia = "1.6"

[extras]
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Expand Down
50 changes: 0 additions & 50 deletions src/IntervalSets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,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))

Expand Down Expand Up @@ -134,50 +131,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)

Expand Down Expand Up @@ -211,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

Expand Down
4 changes: 0 additions & 4 deletions src/interval.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,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)
4 changes: 1 addition & 3 deletions test/findall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down