Skip to content

Display IdOffsetRange fields#193

Closed
jishnub wants to merge 1 commit into
JuliaArrays:masterfrom
jishnub:IdOffsetRange_show
Closed

Display IdOffsetRange fields#193
jishnub wants to merge 1 commit into
JuliaArrays:masterfrom
jishnub:IdOffsetRange_show

Conversation

@jishnub
Copy link
Copy Markdown
Member

@jishnub jishnub commented Jan 19, 2021

While #179 is still undecided, this is a stop-gap (and hopefully less disputed) solution. In my experience displaying the axes of an OffsetArray is necessary more in debugging than anything else, and having the offsets printed makes life easier. This makes interpreting the axis span a little trickier, but it's possible to get used to this.

After this PR:

julia> a = zeros(3:4, 3:4);

julia> axes(a, 1)
OffsetArrays.IdOffsetRange(1:2, 2)

It's always possible to convert these to UnitRanges wherever necessary:

julia> UnitRange.(axes(a))
(3:4, 3:4)

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 19, 2021

Codecov Report

Merging #193 (90f2af5) into master (b20b4db) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #193   +/-   ##
=======================================
  Coverage   99.28%   99.28%           
=======================================
  Files           5        5           
  Lines         280      280           
=======================================
  Hits          278      278           
  Misses          2        2           
Impacted Files Coverage Δ
src/axes.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b20b4db...90f2af5. Read the comment docs.

@timholy
Copy link
Copy Markdown
Member

timholy commented Feb 21, 2021

Not a fan, unfortunately. Let's do some variant of #179 (it doesn't have to be Pairs syntax, the key is directly specifying both the axes and the values).

@timholy timholy closed this in #208 Mar 4, 2021
@jishnub jishnub deleted the IdOffsetRange_show branch August 18, 2021 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants