Skip to content

Modernize type hints in dimension modules#48

Merged
pnorton-usgs merged 2 commits intodevelopmentfrom
refactor/modernize-dimension-type-hints
May 8, 2026
Merged

Modernize type hints in dimension modules#48
pnorton-usgs merged 2 commits intodevelopmentfrom
refactor/modernize-dimension-type-hints

Conversation

@pnorton-usgs
Copy link
Copy Markdown
Member

Modernize type hints in dimension modules

Summary

Modernize type annotations in Dimension.py and Dimensions.py to use Python 3.10+ syntax, and fix test file naming to follow project conventions.

Changes

  • Replace typing.Dict, Optional, Union with built-in generics and X | Y union syntax
  • Add from __future__ import annotations for runtime compatibility
  • Remove unused class-level annotations in Dimension
  • Simplify super() calls to Python 3 style
  • Remove dead commented-out code
  • Rename test_dimension.pytest_Dimension.py and test_dimensions.pytest_Dimensions.py to match the test_<ClassName>.py convention

Testing

All 290 tests pass. No new mypy errors introduced in the modified files.

- Replace typing.Dict, Optional, Union with built-in generics and X|Y syntax
- Add 'from __future__ import annotations' for runtime compatibility
- Remove unused class-level annotations in Dimension
- Simplify super() calls to Python 3 style
- Remove dead commented-out code
- test_dimension.py -> test_Dimension.py
- test_dimensions.py -> test_Dimensions.py
@pnorton-usgs pnorton-usgs self-assigned this May 8, 2026
@pnorton-usgs pnorton-usgs merged commit a9f85b9 into development May 8, 2026
7 checks passed
@pnorton-usgs pnorton-usgs deleted the refactor/modernize-dimension-type-hints branch May 8, 2026 19:40
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.

1 participant