Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IdOffsetRange kwargs constructor given offset ranges #303

Merged
merged 6 commits into from
Jun 7, 2022

Conversation

jishnub
Copy link
Member

@jishnub jishnub commented Jun 6, 2022

On master

julia> import OffsetArrays: IdOffsetRange

julia> p = OffsetArrays.IdOffsetRange(1:3, 2)
IdOffsetRange(values=3:5, indices=3:5)

julia> IdOffsetRange(values=p.-2, indices=p)
IdOffsetRange(values=1:3, indices=5:7)

The issue here is that p .- 2 preserves its axes on broadcasting. May be fixed easily by stripping the axes.

After this PR

julia> IdOffsetRange(values=p.-2, indices=p)
IdOffsetRange(values=1:3, indices=3:5)

@codecov
Copy link

codecov bot commented Jun 6, 2022

Codecov Report

Merging #303 (8fd3be3) into master (1493303) will increase coverage by 0.03%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #303      +/-   ##
==========================================
+ Coverage   96.38%   96.41%   +0.03%     
==========================================
  Files           5        5              
  Lines         442      446       +4     
==========================================
+ Hits          426      430       +4     
  Misses         16       16              
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 1493303...8fd3be3. Read the comment docs.

Copy link
Member

@johnnychen94 johnnychen94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is a bugfix (patch version), right?

@jishnub
Copy link
Member Author

jishnub commented Jun 7, 2022

Yes, it's a bugfix. I'll bump the patch version

@jishnub jishnub merged commit bec1ae2 into JuliaArrays:master Jun 7, 2022
@jishnub jishnub deleted the IdOffsetfix branch June 7, 2022 04:43
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