Skip to content

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

Closed
lezcano wants to merge 1 commit into
data-apis:mainfrom
lezcano:diagonal_trace
Closed

lezcano wants to merge 1 commit into
data-apis:mainfrom
lezcano:diagonal_trace

Conversation

@lezcano

@lezcano lezcano commented Jul 12, 2021

Copy link
Copy Markdown
Contributor

As per the title.

Fixes #215

Also corrected a small errata.

cc @rgommers @asmeurer

@asmeurer

Copy link
Copy Markdown
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

@rgommers rgommers left a comment

Copy link
Copy Markdown
Member

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

leofang commented Jul 26, 2021

Copy link
Copy Markdown
Contributor

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

@rgommers

Copy link
Copy Markdown
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