fix show for OffsetRanges#200
Conversation
Codecov Report
@@ Coverage Diff @@
## master #200 +/- ##
==========================================
- Coverage 98.25% 98.25% -0.01%
==========================================
Files 5 5
Lines 287 286 -1
==========================================
- Hits 282 281 -1
Misses 5 5
Continue to review full report at Codecov.
|
|
The present way of displaying Also, conventionally the indices displayed correspond to the outermost wrapper, eg. julia> ones(3:3, 4:4)
1×1 OffsetArray(::Matrix{Float64}, 3:3, 4:4) with eltype Float64 with indices 3:3×4:4:
1.0In the case of Would it be better to display this instead as julia> a = OffsetVector(axes(OffsetVector(1:10, -5), 1), 5)
OffsetVector(OffsetArrays.IdOffsetRange(-4:5), 1:10) with indices 1:10This way the output may be copy-pasted as well to create an julia> b = OffsetVector(OffsetArrays.IdOffsetRange(-4:5), 1:10);
julia> b == a
true |
|
Fundamentally we just have to work both the indices and values into |
|
After 837b6d4 the type of the parent array is not displayed anymore, just the values and the indices. julia> a = OffsetVector(axes(OffsetVector(1:10, -5), 1), 5)
-4:5 with indices 1:10 |
Now
Fixes #198 (comment)