Skip to content

Commit

Permalink
fix bounds for Reverse indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Oct 2, 2019
1 parent 99756bc commit b1531d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dimension.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ shortname(d::Type{<:AbDim}) = name(d)
units(dim::AbDim) = metadata(dim) == nothing ? "" : get(metadata(dim), :units, "")

bounds(a, args...) = bounds(dims(a), args...)
bounds(dims::AbDimTuple, lookupdims::Tuple) = bounds(dims[[dimnum(dims, lookupdims)...]])
bounds(dims::AbDimTuple, lookupdims::Tuple) = bounds(dims[[dimnum(dims, lookupdims)...]]...)
bounds(dims::AbDimTuple, dim::DimOrDimType) = bounds(dims[dimnum(dims, dim)])
bounds(dims::AbDimTuple) = (bounds(dims[1]), bounds(tail(dims))...)
bounds(dims::Tuple{}) = ()
bounds(dim::AbDim) = first(val(dim)), last(val(dim))

bounds(dim::AbDim) = bounds(order(dim), dim)
bounds(::Forward, dim::AbDim) = first(val(dim)), last(val(dim))
bounds(::Reverse, dim::AbDim) = last(val(dim)), first(val(dim))

# Base methods

Expand Down

0 comments on commit b1531d2

Please sign in to comment.