Skip to content

Commit

Permalink
Implement indices(A, d) & size(A, d) for StreamingContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Jul 13, 2017
1 parent 6722e7e commit d58e965
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ImageAxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ end
Base.parent(S::StreamingContainer) = S.parent
Base.indices(S::StreamingContainer) = indices(S.parent)
Base.size(S::StreamingContainer) = size(S.parent)
Base.indices(S::StreamingContainer, d) = indices(S.parent, d)
Base.size(S::StreamingContainer, d) = size(S.parent, d)

AxisArrays.axes(S::StreamingContainer) = axes(parent(S))
AxisArrays.axisnames(S::StreamingContainer) = axisnames(axes(S)...)
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ end
S = @inferred6(StreamingContainer{Float64}(f!, P, Axis{:time}()))
@test @inferred(indices(S)) === (Base.OneTo(3), Base.OneTo(4))
@test @inferred(size(S)) == (3,4)
@test @inferred(indices(S, 2)) === Base.OneTo(4)
@test @inferred(size(S, 1)) === 3
@test @inferred(length(S)) == 12
@test @inferred(axisnames(S)) == (:x, :time)
@test @inferred(axisvalues(S)) === (Base.OneTo(3), Base.OneTo(4))
Expand Down

0 comments on commit d58e965

Please # to comment.