Skip to content

Tidy, move parsing from project effects scripts to parsing scripts - #57

Merged
brews merged 2 commits into
ClimateImpactLab:mainfrom
brews:parsing_latlon
Sep 3, 2026
Merged

Tidy, move parsing from project effects scripts to parsing scripts#57
brews merged 2 commits into
ClimateImpactLab:mainfrom
brews:parsing_latlon

Conversation

@brews

@brews brews commented Sep 2, 2026

Copy link
Copy Markdown
Member

scripts/05-project_effects.py includes parsing and cleaning logic when it first reads the input data. This PR tidies up the script and moves this cleaning and parsing logic to scripts/01-parse_era5.py, scripts/01-parse_forecast.py, and scripts/01-parse_gmfd.py.

The logic moved between scripts largely changes "latitude" to "lat", "longitude" to "lon", and shifts the 0-to-360 longitude to -180-to-180, in ascending order.

Logic in scripts/05-project_effects.py to detect and remove incomplete months from the end of forecasts has also been moved into its own function that runs after the forecast ensemble has been loaded into memory. This is a relatively small code cleanup and should not change the script's output.

This PR is a breaking change because it changes the structure of the data output by the above parsing scripts and both bias-adjustment scripts.

Close #37

@codecov-commenter

codecov-commenter commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.95%. Comparing base (86a269d) to head (ca550d1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #57   +/-   ##
=======================================
  Coverage   80.95%   80.95%           
=======================================
  Files           3        3           
  Lines          84       84           
=======================================
  Hits           68       68           
  Misses         16       16           

☔ View full report in Codecov by Harness.
📢 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.

@brews brews self-assigned this Sep 3, 2026
@brews brews added the enhancement New feature or request label Sep 3, 2026
@brews
brews marked this pull request as ready for review September 3, 2026 20:25
@brews
brews merged commit 2b6252d into ClimateImpactLab:main Sep 3, 2026
1 check failed
@brews
brews deleted the parsing_latlon branch September 3, 2026 20:31
brews added a commit that referenced this pull request Sep 3, 2026
brews added a commit that referenced this pull request Sep 3, 2026
ERA5 parsing might have become a bit too unstable after
#57. Persisting data
to the cluster after regridding helps to stabilize workers.
brews added a commit that referenced this pull request Sep 4, 2026
Fixes a reference to old coordinate names when rechunking forecast data
for QDM bias adjustment. This is leftover from
#57.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Longitude cleaning should go into the data cleaning step

2 participants