Add type hinting (fixes DEV-127)#58
Conversation
aptiko
commented
Nov 5, 2025
- Add textbisect
- Add type hinting (fixes DEV-127)
- Add recent changes to the changelog
There was a problem hiding this comment.
Pull Request Overview
This pull request adds comprehensive type hints across the entire codebase and introduces a new textbisect module for binary search in text files. The changes modernize the codebase with type annotations while maintaining backward compatibility through Python 3.7+ compatible syntax using from __future__ import annotations.
Key Changes:
- Added comprehensive type hints to all modules (htimeseries, hspatial, haggregate, evaporation, rocc, enhydris_api_client, enhydris_cache)
- Introduced new
textbisectmodule with binary search functionality for text files - Removed external
textbisectdependency in favor of internal implementation - Added
py.typedmarker files for PEP 561 compliance - Added pyright type checker to CI workflow
Reviewed Changes
Copilot reviewed 42 out of 46 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/textbisect/init.py | New module implementing text file binary search with type hints |
| tests/textbisect/test_textbisect.py | Comprehensive test suite for textbisect functionality |
| src/htimeseries/htimeseries.py | Added type hints for time series operations and file I/O |
| src/hspatial/hspatial.py | Added type hints for spatial interpolation functions |
| src/evaporation/evaporation.py | Added type hints for evapotranspiration calculations |
| src/haggregate/haggregate.py | Added type hints for aggregation operations |
| src/rocc/*.py | Added type hints for rate of change check functionality |
| src/enhydris_api_client/init.py | Added type hints for API client methods |
| src/enhydris_cache/enhydris_cache.py | Added type hints and TypedDict for configuration |
| pyproject.toml | Removed textbisect dependency, added package data config |
| .github/workflows/run-tests.yml | Added pyright type checker to CI |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #58 +/- ##
==========================================
- Coverage 96.40% 95.84% -0.57%
==========================================
Files 18 19 +1
Lines 2032 2261 +229
==========================================
+ Hits 1959 2167 +208
- Misses 73 94 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3ecb4a7 to
1403f5b
Compare
1403f5b to
f82fe16
Compare