Skip to content

Conversation

@mdhaber
Copy link
Contributor

@mdhaber mdhaber commented Oct 31, 2025

Closes gh-502

Copy link
Contributor Author

@mdhaber mdhaber left a comment

Choose a reason for hiding this comment

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

Should address the lint failures.

@lucascolley lucascolley self-requested a review October 31, 2025 23:51
@lucascolley lucascolley added the enhancement New feature or request label Nov 1, 2025
@lucascolley lucascolley added this to the 0.9.1 milestone Nov 1, 2025
Copy link
Member

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

thanks Matt, LGTM!

@lucascolley lucascolley merged commit 39f5889 into data-apis:main Nov 4, 2025
11 checks passed
Copy link
Contributor Author

@mdhaber mdhaber left a comment

Choose a reason for hiding this comment

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

BTW @lucascolley, while we were at it, I wanted to ask about 1) enforcing use of double precision and 2) squeezing all singleton dimensions at the end.

I've heard it argued that double precision arithmetic is essential for accurate covariance calculations.
Double precision arithmetic is essentially always important for "accurate" calculations. Personally, I've never used float32 intentionally, but I understand it's important, and I don't see why fundamental libraries should make the choice for the user.

As for the "indescriminate squeeze", I can see why you might want to eliminate a dimension if the covariance between two univariate samples were viewed as a reducing operation. But that calculation is not really possible with one-argument cov, and there is no reason to use cov to take the variance of a single univariate sample. So really, I don't see any good use case for 1D input anyway, and for any other dimensionality, it's not good to eliminate singleton batch dimensions.

@lucascolley
Copy link
Member

I don't see why fundamental libraries should make the choice for the user

+1

So really, I don't see any good use case for 1D input anyway, and for any other dimensionality, it's not good to eliminate singleton batch dimensions.

Agreed.

@mdhaber
Copy link
Contributor Author

mdhaber commented Nov 4, 2025

Does array_api_extra need deprecation and all that, or can we just change it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH: vectorize cov

2 participants