Skip to content

Modernize type hints in DataFile.py and InputVariable.py#55

Merged
pnorton-usgs merged 1 commit into
developmentfrom
modernize-type-hints
May 12, 2026
Merged

Modernize type hints in DataFile.py and InputVariable.py#55
pnorton-usgs merged 1 commit into
developmentfrom
modernize-type-hints

Conversation

@pnorton-usgs
Copy link
Copy Markdown
Member

Summary

Modernizes type annotations in pyPRMS/input/DataFile.py and pyPRMS/input/InputVariable.py to use Python 3.10+ syntax.

Changes

  • Add from __future__ import annotations to both files
  • Replace typing.Dict, List, Optional, Union with built-in generics and X | Y union syntax
  • Import Sequence from collections.abc instead of typing
  • Fix InputVariable.full_column_names return type annotation (dict, not list)
  • Add explicit type annotation for DataFile.__station_meta_header

Testing

  • Verified clean import of both modules
  • No new mypy errors introduced (pre-existing issues in other files remain unchanged)

- Add 'from __future__ import annotations' to both files
- Replace typing.Dict, List, Optional, Union with built-in generics and | syntax
- Import Sequence from collections.abc instead of typing
- Fix full_column_names return type annotation (dict, not list)
- Add explicit type annotation for __station_meta_header
@pnorton-usgs pnorton-usgs self-assigned this May 12, 2026
@pnorton-usgs pnorton-usgs merged commit 2ebf9a8 into development May 12, 2026
14 checks passed
@pnorton-usgs pnorton-usgs deleted the modernize-type-hints branch May 12, 2026 14:00
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