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

Add permute and transpose methods for changing the order of axes of a PyArray #428

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

adamreichold
Copy link
Member

Closes #424

Copy link
Contributor

@Icxolu Icxolu left a comment

Choose a reason for hiding this comment

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

Apart from a small typo this looks good to me.

I think we don't necessarily need to provide new APIs in a gil-ref variant, but given that these two can easily forward, I also don't see a problem with doing so.

src/array.rs Outdated Show resolved Hide resolved
src/array.rs Outdated Show resolved Hide resolved
src/array.rs Outdated Show resolved Hide resolved
@adamreichold
Copy link
Member Author

I think we don't necessarily need to provide new APIs in a gil-ref variant, but given that these two can easily forward, I also don't see a problem with doing so.

Indeed, I thought about leaving them out, but since this will probably go out as a patch release and it does not really cost us anything, I added it anyway.

@adamreichold
Copy link
Member Author

@akern40 I would be glad to get your feedback of whether this resolves your issue, but I also think that this is generally useful enough to merge based on @Icxolu's review.

@adamreichold adamreichold merged commit 2170e16 into main Apr 17, 2024
35 checks passed
@adamreichold adamreichold deleted the transpose branch April 17, 2024 19:04
@akern40
Copy link

akern40 commented Apr 18, 2024

Thank you for the support! This lets me achieve what I was originally looking for; it still creates an extra object on the Python side, but that should be a view of the original NumPy array and therefore achieves the kind of cheap transfer I needed (I checked this in code, as well). Plus, it has the advantage of being more general than my initial suggestion. Thanks again!

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.

Support nalgebra transposed conversion
3 participants