JuliaArrays / OffsetArrays.jl

Fortran-like arrays with arbitrary, zero or negative starting indices.
Other
195 stars 40 forks source link

Add docs for values and indices retrieval from IdOffsetRange #317

Open mkitti opened 1 year ago

mkitti commented 1 year ago

This is a reduced version of #316 by simply documenting how to retrieve the values and indices shown by Base.show.

Added Documentation

The values and indices keywords can be extracted via Base.values or Base.eachindex and converted to a UnitRange.

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
codecov[bot] commented 1 year ago

Codecov Report

Merging #317 (341f8cc) into master (08dc371) will increase coverage by 2.22%. The diff coverage is n/a.

@@            Coverage Diff             @@
##           master     #317      +/-   ##
==========================================
+ Coverage   96.45%   98.67%   +2.22%     
==========================================
  Files           5        5              
  Lines         451      452       +1     
==========================================
+ Hits          435      446      +11     
+ Misses         16        6      -10     
Impacted Files Coverage Δ
src/axes.jl 100.00% <ø> (ø)
src/OffsetArrays.jl 98.29% <0.00%> (+<0.01%) :arrow_up:
src/precompile.jl 100.00% <0.00%> (+100.00%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more