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

Implements newaxis #35

Merged
merged 25 commits into from
Aug 13, 2020
Merged

Implements newaxis #35

merged 25 commits into from
Aug 13, 2020

Conversation

melissawm
Copy link
Member

Closes #24

ndindex/slice.py Outdated
>>> idx.newshape((8, 10), axis=1)
(8, 6)
"""
from . import Tuple
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be this at the top?

Copy link
Member

Choose a reason for hiding this comment

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

You can try it but it might fail due to circular imports.

ndindex/slice.py Outdated Show resolved Hide resolved
@scopatz
Copy link
Contributor

scopatz commented Jun 4, 2020

Code looks good to me

@scopatz
Copy link
Contributor

scopatz commented Jun 13, 2020

@asmeurer - please review and merge

@@ -2,6 +2,9 @@

from numpy import ndarray

newaxis = None
Copy link
Member

Choose a reason for hiding this comment

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

This needs to be implemented as an NDIndex subclass.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I just went with that NumPy does. Let me know if this is what you had in mind

@scopatz scopatz added this to the June 2020 milestone Jun 17, 2020
@asmeurer
Copy link
Member

I've pushed updates here. This is ready for review.

Copy link
Member Author

@melissawm melissawm left a comment

Choose a reason for hiding this comment

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

This is much more complicated than I had anticipated, thanks @asmeurer , I have no objections!

@asmeurer
Copy link
Member

Yes, getting the logic for newaxis right in the various Tuple methods was not easy. However, I've run the hypothesis test suite with lots of examples and no failures, so I'm fairly confident the code here is correct.

@asmeurer asmeurer merged commit 61440fd into Quansight-Labs:master Aug 13, 2020
@ericdatakelly ericdatakelly modified the milestones: June 2020, August 2020 Sep 1, 2020
@ericdatakelly ericdatakelly modified the milestones: August 2020, September 2020 Sep 11, 2020
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.

Implement Newaxis
4 participants