Skip to content

Add type hinting (fixes DEV-127)#58

Merged
aptiko merged 4 commits intoopenmeteo:masterfrom
aptiko:dev-127--type-hints
Nov 6, 2025
Merged

Add type hinting (fixes DEV-127)#58
aptiko merged 4 commits intoopenmeteo:masterfrom
aptiko:dev-127--type-hints

Conversation

@aptiko
Copy link
Copy Markdown
Member

@aptiko aptiko commented Nov 5, 2025

  • Add textbisect
  • Add type hinting (fixes DEV-127)
  • Add recent changes to the changelog

@aptiko aptiko requested a review from Copilot November 5, 2025 11:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 textbisect module with binary search functionality for text files
  • Removed external textbisect dependency in favor of internal implementation
  • Added py.typed marker 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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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
Copy link
Copy Markdown

codecov bot commented Nov 5, 2025

Codecov Report

❌ Patch coverage is 95.21073% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.84%. Comparing base (9187e42) to head (f82fe16).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/enhydris_cache/cli.py 84.78% 7 Missing ⚠️
src/htimeseries/htimeseries.py 95.71% 6 Missing ⚠️
src/enhydris_cache/enhydris_cache.py 91.11% 4 Missing ⚠️
src/enhydris_api_client/__init__.py 92.85% 3 Missing ⚠️
src/haggregate/haggregate.py 94.59% 2 Missing ⚠️
src/evaporation/cli.py 75.00% 1 Missing ⚠️
src/hspatial/cli.py 93.75% 1 Missing ⚠️
src/hspatial/hspatial.py 98.41% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@aptiko aptiko force-pushed the dev-127--type-hints branch from 3ecb4a7 to 1403f5b Compare November 6, 2025 10:37
@aptiko aptiko force-pushed the dev-127--type-hints branch from 1403f5b to f82fe16 Compare November 6, 2025 10:45
@aptiko aptiko merged commit f82fe16 into openmeteo:master Nov 6, 2025
4 checks passed
@aptiko aptiko deleted the dev-127--type-hints branch November 6, 2025 10:47
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.

2 participants