Skip to content

Preserve mapped dates in HazardForecast.from_xarray_raster - #1310

Merged
peanutfun merged 1 commit into
CLIMADA-project:developfrom
giovannicozzolongo:fix/hazardforecast-explicit-date
Aug 20, 2026
Merged

Preserve mapped dates in HazardForecast.from_xarray_raster#1310
peanutfun merged 1 commit into
CLIMADA-project:developfrom
giovannicozzolongo:fix/hazardforecast-explicit-date

Conversation

@giovannicozzolongo

Copy link
Copy Markdown

Changes proposed in this PR:

  • Preserve dates loaded from an explicit date entry in data_vars.
  • Keep zero-valued forecast dates when no date mapping is supplied, with regression coverage for both paths.

This PR fixes #1305

Tests:

  • python -m pytest -q climada/hazard/test/test_forecast.py (56 passed)
  • python -m pytest -q climada/hazard/test/test_xarray.py climada/hazard/test/test_io.py (18 passed)
  • pre-commit run --files AUTHORS.md CHANGELOG.md climada/hazard/forecast.py climada/hazard/test/test_forecast.py
  • pylint climada/hazard/forecast.py climada/hazard/test/test_forecast.py (9.35/10, unchanged)

PR Author Checklist

PR Reviewer Checklist

@peanutfun peanutfun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Excellent contribution, thanks a lot @giovannicozzolongo ! 🎉

All tests succeed on my computer as well, so I'll merge.

@peanutfun
peanutfun merged commit d2af313 into CLIMADA-project:develop Aug 20, 2026
2 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.

2 participants