Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nrontsis committed Oct 27, 2022
1 parent 419105f commit 7bc3561
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/array_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ function Base.cat(inputs::ComponentArray...; dims::Int)
end
end

Base.hcat(inputs::ComponentArray...) = Base.cat(inputs...; dims=2)
Base.vcat(inputs::ComponentArray...) = Base.cat(inputs...; dims=1)
function Base._typed_hcat(::Type{T}, inputs::Base.AbstractVecOrTuple{ComponentArray}) where {T}
return Base.cat(map(i -> T.(i), inputs)...; dims=2)
end
Expand Down
2 changes: 1 addition & 1 deletion src/axis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Base.keys(ax::AbstractAxis) = keys(indexmap(ax))
reindex(i, offset) = i .+ offset
reindex(ax::FlatAxis, _) = ax
reindex(ax::Axis, offset) = Axis(map(x->reindex(x, offset), indexmap(ax)))
reindex(ax::ViewAxis, offset) = ViewAxis(viewindex(ax) .+ offset, indexmap(ax))
reindex(ax::ViewAxis{Inds,IdxMap,Ax}, offset) where {Inds, IdxMap, Ax} = ViewAxis(viewindex(ax) .+ offset, Ax())

# Get AbstractAxis index
@inline Base.getindex(::AbstractAxis, idx) = ComponentIndex(idx)
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ end
@test length(vtempca) == length(temp) + length(ca)
@test [ca; ca; ca] isa Vector
@test vcat(ca, 100) isa Vector
@test [ca' ca']' isa Vector
@test [ca' ca']' isa Adjoint{T, Matrix{T}} where T
@test keys(getaxes([ca' temp']')[1]) == (:a, :b, :c, :q, :r)

# Getting serious about axes
Expand Down

0 comments on commit 7bc3561

Please sign in to comment.