Skip to content

Preserve qualified type names in PR06 validation - #719

Open
xiex16070-jpg wants to merge 1 commit into
numpy:mainfrom
xiex16070-jpg:fix/pr06-qualified-type-names
Open

xiex16070-jpg wants to merge 1 commit into
numpy:mainfrom
xiex16070-jpg:fix/pr06-qualified-type-names

Conversation

@xiex16070-jpg

Copy link
Copy Markdown

np.integer is a valid NumPy type in npt.NDArray[np.floating | np.integer]. Previously, the PR06 check split np.integer at the dot and incorrectly suggested replacing integer with int.

The check now treats np.integer as a single qualified name. It still recommends int when integer appears on its own, even if np.integer appears in the same type expression. The regression tests cover both cases.

Closes #633.

AI disclosure

  • I did not use AI tools for this PR.
  • I used OpenAI Codex to generate the validation changes in numpydoc/validate.py and the regression test changes in numpydoc/tests/test_validate.py.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NumPy NDArray typing conflict with numpydoc for np.integer.

1 participant