Skip to content

Commit

Permalink
Add docs for values and indices retrieval from IdOffsetRange
Browse files Browse the repository at this point in the history
  • Loading branch information
mkitti committed Dec 25, 2022
1 parent 08dc371 commit 341f8cc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/axes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ julia> ro[3]
ERROR: BoundsError: attempt to access 3-element $(IdOffsetRange{Int, UnitRange{Int}}) with indices -1:1 at index [3]
```
The `values` and `indices` keywords can be extracted via `Base.values` or `Base.eachindex` and converted to a `UnitRange`.
```jldoctest ior
julia> values(ro)
IdOffsetRange(values=9:11, indices=-1:1)
julia> eachindex(ro)
IdOffsetRange(values=-1:1, indices=-1:1)
julia> UnitRange(values(ro))
9:11
julia> convert(UnitRange, eachindex(ro))
-1:1
```
# Extended help
Construction/coercion preserves the (shifted) values of the input range, but may modify
Expand Down

0 comments on commit 341f8cc

Please sign in to comment.