Skip to content

Commit 404fca1

Browse files
authored
Remove unused IdxMap type parameter from ShapedAxis (#244)
1 parent 35221bd commit 404fca1

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

src/axis.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,21 @@ const NullorFlatAxis = Union{NullAxis, FlatAxis}
5959

6060

6161
"""
62-
sa = ShapedAxis(shape, index_map)
62+
sa = ShapedAxis(shape)
6363
6464
Preserves higher-dimensional array components in `ComponentArray`s (matrix components, for
6565
example)
6666
"""
67-
struct ShapedAxis{Shape, IdxMap} <: AbstractAxis{IdxMap} end
68-
@inline ShapedAxis(Shape, IdxMap) = ShapedAxis{Shape, IdxMap}()
69-
ShapedAxis(Shape) = ShapedAxis(Shape, NamedTuple())
67+
struct ShapedAxis{Shape} <: AbstractAxis{nothing} end
68+
@inline ShapedAxis(Shape) = ShapedAxis{Shape}()
7069
ShapedAxis(::Tuple{<:Int}) = FlatAxis()
7170

7271
const Shape = ShapedAxis
7372

7473
unshape(ax) = ax
7574
unshape(ax::ShapedAxis) = Axis(indexmap(ax))
7675

77-
Base.size(::ShapedAxis{Shape, IdxMap}) where {Shape, IdxMap} = Shape
76+
Base.size(::ShapedAxis{Shape}) where {Shape} = Shape
7877

7978

8079

@@ -135,7 +134,7 @@ Axis(::NamedTuple{()}) = FlatAxis()
135134
Axis(x) = FlatAxis()
136135

137136
const NotShapedAxis = Union{Axis{IdxMap}, FlatAxis, NullAxis} where {IdxMap}
138-
const NotPartitionedAxis = Union{Axis{IdxMap}, FlatAxis, NullAxis, ShapedAxis{Shape, IdxMap}} where {Shape, IdxMap}
137+
const NotPartitionedAxis = Union{Axis{IdxMap}, FlatAxis, NullAxis, ShapedAxis{Shape}} where {Shape, IdxMap}
139138
const NotShapedOrPartitionedAxis = Union{Axis{IdxMap}, FlatAxis, NullAxis} where {IdxMap}
140139

141140

src/show.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ Base.show(io::IO, ::MIME"text/plain", ::PartitionedAxis{PartSz, IdxMap, Ax}) whe
1212
Base.show(io::IO, ::PartitionedAxis{PartSz, IdxMap, Ax}) where {PartSz, IdxMap, Ax} =
1313
print(io, "PartitionedAxis($PartSz, $(Ax()))")
1414

15-
Base.show(io::IO, ::ShapedAxis{Shape, IdxMap}) where {Shape, IdxMap} =
16-
print(io, "ShapedAxis($Shape, $IdxMap)")
15+
Base.show(io::IO, ::ShapedAxis{Shape}) where {Shape} =
16+
print(io, "ShapedAxis($Shape)")
1717

18-
Base.show(io::IO, ::MIME"text/plain", ::ViewAxis{Inds, IdxMap, Ax}) where {Inds, IdxMap, Ax} =
18+
Base.show(io::IO, ::MIME"text/plain", ::ViewAxis{Inds, IdxMap, Ax}) where {Inds, IdxMap, Ax} =
1919
print(io, "ViewAxis($Inds, $(Ax()))")
20-
Base.show(io::IO, ::ViewAxis{Inds, IdxMap, <:Ax}) where {Inds, IdxMap, Ax} =
20+
Base.show(io::IO, ::ViewAxis{Inds, IdxMap, <:Ax}) where {Inds, IdxMap, Ax} =
2121
print(io, "ViewAxis($Inds, $(Ax()))")
22-
Base.show(io::IO, ::ViewAxis{Inds, IdxMap, <:NullorFlatAxis}) where {Inds, IdxMap} =
22+
Base.show(io::IO, ::ViewAxis{Inds, IdxMap, <:NullorFlatAxis}) where {Inds, IdxMap} =
2323
print(io, Inds)
2424

2525
Base.show(io::IO, ci::ComponentIndex) = print(io, "ComponentIndex($(ci.idx), $(ci.ax))")

0 commit comments

Comments
 (0)