Skip to content

Fix Windows GRIB splitting without grib_copy#24

Merged
CyrilJl merged 1 commit into
mainfrom
fix/windows-large-grib-split
Jul 9, 2026
Merged

Fix Windows GRIB splitting without grib_copy#24
CyrilJl merged 1 commit into
mainfrom
fix/windows-large-grib-split

Conversation

@CyrilJl

@CyrilJl CyrilJl commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix Windows handling of GRIB files larger than 2 GiB without relying on the external grib_copy executable.
  • Split large GRIB files through the Python ecCodes API before opening per-variable datasets with cfgrib.

Main changes

  • Add a shortName-based splitter in meteofetch/_model.py using codes_grib_new_from_file, codes_get, codes_write, and codes_release.
  • Keep cfgrib import lazy so unit tests can mock the reader without requiring the native ecCodes library at import time.
  • Add focused tests for message grouping and the Windows large-file read path.

Validation

  • rtk uv run --extra test pytest -q tests/test_model_grib_split.py
  • rtk python3 -m compileall meteofetch tests
  • rtk proxy git diff --check

@CyrilJl CyrilJl self-assigned this Jul 9, 2026
@CyrilJl
CyrilJl merged commit 638de29 into main Jul 9, 2026
4 checks passed
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