Skip to content

Change FileStream to use absolute paths#436

Open
DWesl wants to merge 1 commit intoecmwf:masterfrom
DWesl:patch-3
Open

Change FileStream to use absolute paths#436
DWesl wants to merge 1 commit intoecmwf:masterfrom
DWesl:patch-3

Conversation

@DWesl
Copy link
Contributor

@DWesl DWesl commented Nov 5, 2025

Description

Currently, accessing a grib file first by a relative path then by an absolute path causes cfgrib to reject the index, as would acessing the file by a relative path from a different working directory.

This change ensures the path stored in the index file is absolute, so the index file validator will find a match regardless of whether the file is accessed by a relative path or an absolute path.

Contributor Declaration

By opening this pull request, I affirm the following:

  • All authors agree to the Contributor License Agreement.
  • The code follows the project's coding standards.
  • I have performed self-review and added comments where needed.
  • I have added or updated tests to verify that my changes are effective and functional.
  • I have run all existing tests and confirmed they pass.

Currently, accessing a grib file first by a relative path then by an absolute path causes cfgrib to reject the index, as would acessing the file by a relative path from a different working directory.

This change ensures the path stored in the index file is absolute, so the index file validator will find a match regardless of whether the file is accessed by a relative path or an absolute path.
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 41.76%. Comparing base (44ecc62) to head (18639c7).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
cfgrib/messages.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #436   +/-   ##
=======================================
  Coverage   41.76%   41.76%           
=======================================
  Files          26       26           
  Lines        2227     2227           
  Branches      195      195           
=======================================
  Hits          930      930           
  Misses       1297     1297           

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants