Skip to content

MAINT: silence invalid warning for np.exp(complex(np.nan, np.nan)) and such - #32751

Open
mdhaber wants to merge 2 commits into
numpy:mainfrom
mdhaber:test-cexp-nan-warnings
Open

mdhaber wants to merge 2 commits into
numpy:mainfrom
mdhaber:test-cexp-nan-warnings

Conversation

@mdhaber

@mdhaber mdhaber commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

PR summary

On some platforms, np.exp with complex NaN input produce invalid warnings. Based on the behavior of other ufuncs and other precedent (e.g. gh-12236, gh-15988, gh-32602, and now gh-32706), I don't think this is desired anymore. This silences the warnings by providing an early return path.

AI Disclosure

OpenAI Codex was used to inspect the relevant implementation and tests, draft
the code changes and regression tests, and prepare this AI disclosure.

@mdhaber mdhaber changed the title TST: Check complex exp with NaN components MAINT: silence invalid warning for np.exp(complex(np.nan, np.nan)) and such Sep 22, 2026
@mdhaber
mdhaber marked this pull request as ready for review September 23, 2026 00:25

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant