Skip to content

Conversation

mdhaber
Copy link
Contributor

@mdhaber mdhaber commented Jun 28, 2024

Reference issue

Toward gh-20544

What does this implement/fix?

Adds array API support to differential_entropy.

Additional information

Turned out pretty clean, I think.

@mdhaber mdhaber added scipy.stats enhancement A new feature or improvement array types Items related to array API support and input array validation (see gh-18286) labels Jun 28, 2024
@mdhaber
Copy link
Contributor Author

mdhaber commented Jun 28, 2024

Does anyone more familiar with typing know why mypy doesn't know about distributions (e.g. stats.norm, stats.entropy)?

scipy/stats/tests/test_entropy.py:274: error: Module has no attribute "norm"  [attr-defined]
scipy/stats/tests/test_entropy.py:275: error: Module has no attribute "expon"  [attr-defined]

We have a few type: ignore[attr-defined] for this reason, but I wonder if there's a way to fix it permanently.
In the meantime, I suppose we can import them at the top and have only one ignore.

The array API failures are unrelated (gh-21073).

@mdhaber mdhaber closed this Jun 30, 2024
@mdhaber mdhaber reopened this Jun 30, 2024
Copy link
Member

@j-bowhay j-bowhay left a comment

Choose a reason for hiding this comment

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

Thanks @mdhaber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
array types Items related to array API support and input array validation (see gh-18286) enhancement A new feature or improvement scipy.stats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants