Skip to content

Conversation

@timholy
Copy link
Member

@timholy timholy commented Sep 26, 2021

This specializes axes for ReshapedReinterpretArray, and streamlines a
bit of the code surrounding this type.

@codecov
Copy link

codecov bot commented Sep 26, 2021

Codecov Report

Merging #210 (64a83b7) into master (ad11cc1) will increase coverage by 0.46%.
The diff coverage is 92.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #210      +/-   ##
==========================================
+ Coverage   86.31%   86.78%   +0.46%     
==========================================
  Files          11       11              
  Lines        1812     1808       -4     
==========================================
+ Hits         1564     1569       +5     
+ Misses        248      239       -9     
Impacted Files Coverage Δ
src/axes.jl 75.42% <85.71%> (+3.49%) ⬆️
src/stridelayout.jl 89.94% <93.54%> (+0.66%) ⬆️
src/ArrayInterface.jl 86.13% <100.00%> (+0.22%) ⬆️

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 ad11cc1...64a83b7. Read the comment docs.

This specializes `axes` for ReshapedReinterpretArray, and streamlines a
bit of the code surrounding this type.
@Tokazama
Copy link
Member

Is this ready for review

Copy link
Collaborator

@chriselrod chriselrod left a comment

Choose a reason for hiding this comment

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

I guess this library has transitioned from tabs = 2 -> tabs = 4 spaces?

@timholy
Copy link
Member Author

timholy commented Sep 27, 2021

Is this ready for review

Yes. It doesn't implement anything for non-reshaped ReinterpretArray (in a sense, that's the harder case), and I added a @broken test to indicate one unfortunate issue. But I think the implementation for a reinterpret(reshape, ...) is "done."

I guess this library has transitioned from tabs = 2 -> tabs = 4 spaces?

Not sure if you mean they were tabs before and spaces now (sorry, if I didn't notice and perhaps I should have updated my definition of tab), or if just the default indent had changed. Mostly I found the mix awkward and the 4-space indent dominates, so I went with that.

@test @inferred(ArrayInterface.strides(u_view_reinterpreted)) == (4,)
@test @inferred(ArrayInterface.strides(u_view_reshaped)) == (4, 4)

@test_broken @inferred(ArrayInterface.axes(u_vectors)) isa ArrayInterface.axes_types(u_vectors)
Copy link
Collaborator

@chriselrod chriselrod Sep 27, 2021

Choose a reason for hiding this comment

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

I take it that inference fails here?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it's that it isn't of the type returned by axes_types.

Copy link
Member

Choose a reason for hiding this comment

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

I need to do some clean up on axes and can fix this. I think we need to just go all in on OptionallyStaticUnitRange here.

Copy link
Member Author

Choose a reason for hiding this comment

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

No worries, and no hurry (there's nothing wrong with a broken test, it's essentially a TODO list).

Copy link
Member

Choose a reason for hiding this comment

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

Did you want me to fix this before this PR went forward or afterwards. Just want to make sure this PR isn't stalled because of me.

@Tokazama
Copy link
Member

Tokazama commented Oct 6, 2021

@timholy, is this ready to be merged?

Tokazama added a commit that referenced this pull request Oct 29, 2021
…#222)

* +axis support methods from base and +tests
* Get rid of some no good very bad spaghetti code.
* Document examples of how to use axes here.
* Incorporate ReinterpretArray changes from ArrayInterface.axes for ReshapedReinterpretArray #210. Don't assume we can go to parent arrays anymore because there are too many assumptions (offsets, sizing, views, etc) that can change it.
* Document `SoneTo`
@timholy
Copy link
Member Author

timholy commented Feb 8, 2022

Just checking, this effectively got merged in #222, right? So close?

@Tokazama
Copy link
Member

Tokazama commented Feb 8, 2022

It incorporates the same tests so unless there was something else needed here this should be good to close

@timholy timholy closed this Feb 8, 2022
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.

4 participants