Skip to content

Commit 032bde4

Browse files
committed
remove doublets
1 parent c57bc02 commit 032bde4

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

NDTensors/src/lib/GradedAxes/src/gradedunitrange.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ function space_isequal(a1::AbstractUnitRange, a2::AbstractUnitRange)
6969
return (isdual(a1) == isdual(a2)) && labelled_isequal(a1, a2)
7070
end
7171

72-
# TODO: See if this is needed.
73-
function Base.AbstractUnitRange{T}(a::GradedOneTo{<:LabelledInteger{T}}) where {T}
74-
return unlabel_blocks(a)
75-
end
76-
7772
# TODO: Use `TypeParameterAccessors`.
7873
Base.eltype(::Type{<:GradedUnitRange{T}}) where {T} = T
7974

NDTensors/src/lib/GradedAxes/src/gradedunitrangedual.jl

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ Base.step(a::GradedUnitRangeDual) = label_dual(step(nondual(a)))
1717

1818
Base.view(a::GradedUnitRangeDual, index::Block{1}) = a[index]
1919

20-
function Base.show(io::IO, a::GradedUnitRangeDual)
21-
return print(io, GradedUnitRangeDual, "(", blocklasts(a), ")")
22-
end
23-
24-
function Base.show(io::IO, mimetype::MIME"text/plain", a::GradedUnitRangeDual)
25-
return Base.invoke(
26-
show, Tuple{typeof(io),MIME"text/plain",AbstractArray}, io, mimetype, a
27-
)
28-
end
29-
3020
function Base.getindex(a::GradedUnitRangeDual, indices::AbstractUnitRange{<:Integer})
3121
return dual(getindex(nondual(a), indices))
3222
end
@@ -88,10 +78,7 @@ function BlockArrays.BlockSlice(b::Block, r::GradedUnitRangeDual)
8878
return BlockSlice(b, dual(r))
8979
end
9080

91-
using NDTensors.LabelledNumbers: LabelledNumbers, label
92-
LabelledNumbers.label(a::GradedUnitRangeDual) = dual(label(nondual(a)))
93-
94-
using NDTensors.LabelledNumbers: LabelledUnitRange
81+
using NDTensors.LabelledNumbers: LabelledNumbers, LabelledUnitRange, label
9582
# The Base version of `length(::AbstractUnitRange)` drops the label.
9683
function Base.length(a::GradedUnitRangeDual{<:Any,<:LabelledUnitRange})
9784
return dual(length(nondual(a)))
@@ -131,15 +118,6 @@ function Base.OrdinalRange{Int,Int}(
131118
return unlabel(nondual(r))
132119
end
133120

134-
# This is only needed in certain Julia versions below 1.10
135-
# (for example Julia 1.6).
136-
# TODO: Delete this once we drop Julia 1.6 support.
137-
# The type constraint `T<:Integer` is needed to avoid an ambiguity
138-
# error with a conversion method in Base.
139-
function Base.UnitRange{T}(a::GradedUnitRangeDual{<:LabelledInteger{T}}) where {T<:Integer}
140-
return UnitRange{T}(nondual(a))
141-
end
142-
143121
function unlabel_blocks(a::GradedUnitRangeDual)
144122
return unlabel_blocks(nondual(a))
145123
end

0 commit comments

Comments
 (0)