Skip to content

Commit 20009e1

Browse files
committed
use BlockLasts as argument name
1 parent 0c6f7e5 commit 20009e1

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

NDTensors/src/lib/BlockSparseArrays/ext/BlockSparseArraysGradedAxesExt/test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ const elts = (Float32, Float64, Complex{Float32}, Complex{Float64})
141141
end
142142
@test axes(a') == dual.(reverse(axes(a)))
143143

144-
@test isdual(axes(a', 1)) isdual(axes(a, 2))
145-
@test isdual(axes(a', 2)) isdual(axes(a, 1))
144+
@test isdual(axes(a', 1)) isdual(axes(a, 2))
145+
@test isdual(axes(a', 2)) isdual(axes(a, 1))
146146
@test isnothing(show(devnull, MIME("text/plain"), a))
147147

148148
# Check preserving dual in tensor algebra.

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ using ..LabelledNumbers:
3131
labelled_isequal,
3232
unlabel
3333

34-
abstract type AbstractGradedUnitRange{T,CS} <: AbstractBlockedUnitRange{T,CS} end
34+
abstract type AbstractGradedUnitRange{T,BlockLasts} <:
35+
AbstractBlockedUnitRange{T,BlockLasts} end
3536

3637
struct GradedUnitRange{T,BlockLasts<:Vector{T}} <: AbstractGradedUnitRange{T,BlockLasts}
3738
first::T
@@ -42,14 +43,14 @@ struct GradedOneTo{T,BlockLasts<:Vector{T}} <: AbstractGradedUnitRange{T,BlockLa
4243
lasts::BlockLasts
4344

4445
# assume that lasts is sorted, no checks carried out here
45-
function GradedOneTo(lasts::CS) where {T<:Integer,CS<:AbstractVector{T}}
46+
function GradedOneTo(lasts::BlockLasts) where {T<:Integer,BlockLasts<:AbstractVector{T}}
4647
Base.require_one_based_indexing(lasts)
4748
isempty(lasts) || first(lasts) >= 0 || throw(ArgumentError("blocklasts must be >= 0"))
48-
return new{T,CS}(lasts)
49+
return new{T,BlockLasts}(lasts)
4950
end
50-
function GradedOneTo(lasts::CS) where {T<:Integer,CS<:Tuple{T,Vararg{T}}}
51+
function GradedOneTo(lasts::BlockLasts) where {T<:Integer,BlockLasts<:Tuple{T,Vararg{T}}}
5152
first(lasts) >= 0 || throw(ArgumentError("blocklasts must be >= 0"))
52-
return new{T,CS}(lasts)
53+
return new{T,BlockLasts}(lasts)
5354
end
5455
end
5556

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
struct GradedUnitRangeDual{T,CS,NondualUnitRange<:AbstractGradedUnitRange{T,CS}} <:
2-
AbstractGradedUnitRange{T,CS}
1+
struct GradedUnitRangeDual{
2+
T,BlockLasts,NondualUnitRange<:AbstractGradedUnitRange{T,BlockLasts}
3+
} <: AbstractGradedUnitRange{T,BlockLasts}
34
nondual_unitrange::NondualUnitRange
45
end
56

0 commit comments

Comments
 (0)