Skip to content
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

BUG: Fix raising ValueError on a zero-size array for SciPy.special.logsumexp #20511

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

tomita-militaru
Copy link
Contributor

Reference issue

Closes gh-20399

What does this implement/fix?

scipy.special.logsumexp raises a ValueError for a zero-size array even though mathematically the correct answer for a zero-size array is -inf, so I've added a check for empty array as simply adding to initial value -np.inf does not work due to typing issues when using for eg. integers in array.

…gsumexp

scipy.special.logsumexp raises a ValueError for a zero-size array even though
mathematically the correct answer for a zero-size array is -inf
Closes scipy#20399
@github-actions github-actions bot added scipy.special defect A clear bug or issue that prevents SciPy from being installed or used as expected labels Apr 17, 2024
@tupui tupui self-assigned this Apr 17, 2024
@tupui
Copy link
Member

tupui commented Apr 17, 2024

Thanks @tomita-militaru LGTM

@tupui tupui merged commit 466627a into scipy:main Apr 17, 2024
30 of 31 checks passed
@tupui tupui added this to the 1.14.0 milestone Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.special
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: scipy.special.logsumexp raises ValueError for a zero-size array
2 participants