Skip to content

Reserve npt for numpy.typing#5349

Open
chrishavlin wants to merge 1 commit into
yt-project:mainfrom
chrishavlin:reserve_npt_for_typing
Open

Reserve npt for numpy.typing#5349
chrishavlin wants to merge 1 commit into
yt-project:mainfrom
chrishavlin:reserve_npt_for_typing

Conversation

@chrishavlin
Copy link
Copy Markdown
Contributor

PR Summary

We've got a couple spots where we import numpy.testing as npt, but it's become pretty ubiquitous to import numpy.typing as npt. with #5346, we'll have a bunch more uses of numpy.typing as npt across the codebase , so this PR cleans up just a few spots to avoid future alias collisions (5346 will change the one remaining stop in yt/testing.py not touched by this PR).

PR Checklist

  • New features are documented, with docstrings and narrative docs
  • Adds a test for any bugs fixed. Adds tests for new features.

@chrishavlin chrishavlin added this to the 4.5.0 milestone Dec 11, 2025
@chrishavlin chrishavlin added the refactor improve readability, maintainability, modularity label Dec 11, 2025
@matthewturk
Copy link
Copy Markdown
Member

This seems right -- should we hold on this?

Copy link
Copy Markdown
Member

@cphyc cphyc left a comment

Choose a reason for hiding this comment

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

LGTM, but I think you're missing one hit in yt/testing.py, line 1882. It's within a test itself, so shouldn't cause any collision tho.

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

Labels

refactor improve readability, maintainability, modularity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants