Skip to content

Change defaults of trace and diagonal to axis1=-2, axis2=-1. #222

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

lezcano
Copy link
Contributor

@lezcano lezcano commented Jul 12, 2021

As per the title.

Fixes #215

Also corrected a small errata.

cc @rgommers @asmeurer

@asmeurer
Copy link
Member

The 0 and 1 defaults come from NumPy. I'm not sure why NumPy uses the first two axes instead of the last two.

@rgommers rgommers added topic: Linear Algebra Linear algebra. API change Changes to existing functions or objects in the API. labels Jul 13, 2021
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks @lezcano! I agree that this makes sense for consistency. I searched the NumPy issue tracker and PRs, and it hasn't been discussed before.

Let's leave it open for at least 3-4 days, given that it's an API change.

@leofang
Copy link
Contributor

leofang commented Jul 26, 2021

Sorry @lezcano, I overlooked this PR and left a question in the original issue.

@rgommers
Copy link
Member

Superceded by gh-241. Thanks @lezcano and @asmeurer

@rgommers rgommers closed this Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API change Changes to existing functions or objects in the API. topic: Linear Algebra Linear algebra.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Consistency] Default axes in linalg.diagonal and linalg.trace.
4 participants