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

[Containers] maintenance of SparseAxisArray.jl #2762

Merged
merged 4 commits into from
Oct 20, 2021
Merged

Conversation

odow
Copy link
Member

@odow odow commented Oct 19, 2021

In particular, this cleans up the broadcast implementation to avoid
private Base functions.

I started to look at the size issue, but I got distracted by style issues. Then I saw the broadcast implementation called Base.Broadcast._broadcast_getindex(bc, I) so I fixed that. I can break up the style part if requested.

In particular, this cleans up the broadcast implementation to avoid
private Base functions.
@odow odow added the Category: Containers Related to the Containers submodule label Oct 19, 2021
@codecov
Copy link

codecov bot commented Oct 19, 2021

Codecov Report

Merging #2762 (2678761) into master (6b48409) will increase coverage by 0.05%.
The diff coverage is 96.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2762      +/-   ##
==========================================
+ Coverage   94.18%   94.23%   +0.05%     
==========================================
  Files          43       43              
  Lines        5520     5517       -3     
==========================================
  Hits         5199     5199              
+ Misses        321      318       -3     
Impacted Files Coverage Δ
src/Containers/SparseAxisArray.jl 96.38% <96.66%> (+3.36%) ⬆️

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 6b48409...2678761. Read the comment docs.

@blegat
Copy link
Member

blegat commented Oct 19, 2021

What's the reason you define copy instead of copyto! ?

@odow
Copy link
Member Author

odow commented Oct 19, 2021

copyto! needs to precompute the axes and call similar. That's a win for things like arrays where you can precompute the storage. For dictionaries, it's less obvious. For example, we weren't preallocating the size of the dictionary in similar.

In addition, if we defined copyto! we have to implement some of the weirder broadcast methods like extrude and newindex to get everything to work. If we implement copy, it's a lot simpler.

@odow odow merged commit f153161 into master Oct 20, 2021
@odow odow deleted the od/sparseaxisarray branch October 20, 2021 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Containers Related to the Containers submodule
Development

Successfully merging this pull request may close these issues.

2 participants