@@ -17,16 +17,6 @@ Base.step(a::GradedUnitRangeDual) = label_dual(step(nondual(a)))
1717
1818Base. 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-
3020function Base. getindex (a:: GradedUnitRangeDual , indices:: AbstractUnitRange{<:Integer} )
3121 return dual (getindex (nondual (a), indices))
3222end
@@ -88,10 +78,7 @@ function BlockArrays.BlockSlice(b::Block, r::GradedUnitRangeDual)
8878 return BlockSlice (b, dual (r))
8979end
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.
9683function 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))
132119end
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-
143121function unlabel_blocks (a:: GradedUnitRangeDual )
144122 return unlabel_blocks (nondual (a))
145123end
0 commit comments