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

C++ refactoring: Implementing combinations #1074

Merged
merged 26 commits into from
Sep 3, 2021
Merged

Conversation

findingmochi
Copy link
Collaborator

@findingmochi findingmochi commented Aug 25, 2021

This PR implements the _combinations function for all the Awkward Array types except VirtualArray.

  • _combinations implementation
  • BitMaskedArray
  • ByteMaskedArray
  • EmptyArray
  • IndexedArray
  • IndexedOptionArray
  • ListArray
  • ListOffsetArray
  • NumpyArray
  • RecordArray
  • RegularArray
  • UnionArray
  • UnmaskedArray
  • _combinations tests
  • BitMaskedArray
  • ByteMaskedArray
  • EmptyArray
  • IndexedArray
  • IndexedOptionArray
  • ListArray
  • ListOffsetArray
  • NumpyArray
  • RecordArray
  • RegularArray
  • UnionArray
  • UnmaskedArray

@findingmochi findingmochi self-assigned this Aug 25, 2021
@findingmochi findingmochi marked this pull request as draft August 25, 2021 13:50
@findingmochi findingmochi marked this pull request as ready for review September 3, 2021 05:27
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

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

We talked on Slack (code reviews are much better when interactive, but unfortunately, we don't get a public log). Some of the things I was worried about were unfounded (declaring the Index as np.intp is exactly the right thing to do, and we do in fact need that ptr property, at least for this exceptional double-pointer case). There were only a few remaining items in an overall excellent PR.

  • centralize the n < 1 check in Content.combinations, so that it doesn't have to be in every _combinations method
  • see if ListArray._combinations can reuse ListOffsetArray._combinations by calling it with itself (its self) as the self argument, and if so, do so
  • add a pytestmark to skip the tests if Python 2

That's it! When you're done, let me know that you're not planning on committing any more changes and I'll merge it when the tests pass.

Thanks again; this is great!

src/awkward/_v2/contents/content.py Outdated Show resolved Hide resolved
src/awkward/_v2/contents/listarray.py Outdated Show resolved Hide resolved
src/awkward/_v2/contents/listoffsetarray.py Outdated Show resolved Hide resolved
src/awkward/_v2/contents/regulararray.py Outdated Show resolved Hide resolved
@findingmochi
Copy link
Collaborator Author

I am done with all the changes, so you can merge this, after the tests pass. Thank You!

@jpivarski jpivarski merged commit b5c2cad into main Sep 3, 2021
@jpivarski jpivarski deleted the stormiestsin/refactoring branch September 3, 2021 16:44
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