Skip to content

add method to produce view with swapped axes #1482

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

Closed
wants to merge 1 commit into from

Conversation

jonaspleyer
Copy link

@jonaspleyer jonaspleyer commented Mar 10, 2025

Instead of calling

let mut aview = array.view();
aview.swap_axes(a, b);
...

we can now simply do

let aview = array.swap_axes_view(a, b);

@nilgoyette
Copy link
Collaborator

Maybe @akern40 has a different opinion, but I don't think we want to add that kind of function. Having too much functions hurts discoverability.

@akern40
Copy link
Collaborator

akern40 commented Mar 19, 2025

Ya this is a recurring topic in our PRs, and one that I think needs addressing more thoroughly. I think @nilgoyette is right - this function turns a two-liner into a one-liner, and I'm not sure it's worth the impact on the discoverability. However, I also think we need to come up with some sort of reasoning for which methods to accept so that contributors can understand what kinds of functions we would accept, or what the criteria are for acceptance.

@jonaspleyer
Copy link
Author

Thanks for the response. I can very much relate to your viewpoint. My proposal would be to add a note (by using templates) when creating a new PR or Issue in Github. By using such templates, contributors will get notified. If they ignore said notes, it is easy to point to them.

@akern40
Copy link
Collaborator

akern40 commented Mar 20, 2025

Thanks for understanding, and for the suggestion - I'd love to have a template we could use, eventually. First, we need to work with the community to articulate which functions we want and which we don't.

@jonaspleyer
Copy link
Author

Thanks for understanding, and for the suggestion - I'd love to have a template we could use, eventually. First, we need to work with the community to articulate which functions we want and which we don't.

I have opened a new discussion to come up with possible guidelines. However I think we could still add a note which points to said discussion which basically says:
"We are currently reviewing our guidelines as to what should be included in this library and what is considered a shallow addition and should be omitted. Think carefully if the proposed functionality should be added. (see discussion #1493)"

@jonaspleyer
Copy link
Author

Closing this in favor of #1493

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.

3 participants