Skip to content

Say where weather data ends when run dates go past it - #41

Open
mrke wants to merge 2 commits into
Docsfrom
weather-coverage-error
Open

mrke wants to merge 2 commits into
Docsfrom
weather-coverage-error

Conversation

@mrke

@mrke mrke commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

If a run's dates go past the last day a weather source has published, solve now fails with a message saying where the data ends, instead of a BoundsError from slicing the time axis.

ERA5ECMWFLand: weather data is only available to 2026-08-29 -- end the run dates on or before then (recent data may not be published yet)

_check_ti_length deliberately lets a partly filled current year through. That's needed for near-real-time sources like SILO and for ECMWF's ERA5-Land store, which runs about six weeks behind real time. But run dates past the last published day then reached the Ti(ti_start:ti_end) slice and threw BoundsError: attempt to access 1×5784 Matrix{Float64} at index [1:1, 3625:5832]. That error doesn't say the data simply isn't out yet. It came up running an ERA5-Land history up to 31 August 2026, when the store ended on the 29th.

The new _check_weather_covers compares the loaded Ti length with the run's last step. It runs right after weather loading at all three slicing sites: raster mode, points mode, and points mode via an area load. In raster mode it runs before the resample to the template, so the run fails before that expensive step. Daily sources report the last available date; monthly sources report how many steps they have.

Testing: test/weather_coverage.jl (5 tests) reproduces the ERA5-Land case, checks the passing cases, and checks the monthly message. The existing era5ecmwf tests still pass.

This is based on Docs (#39), like #40, and is independent of #40.

🤖 Generated with Claude Code

mrke and others added 2 commits October 15, 2026 08:51
`_check_ti_length` lets a trailing partial year through (e.g. ERA5-Land's
store, ~6 weeks behind real time), so run dates past the last published
day reached the Ti slice and threw an opaque BoundsError. Check coverage
right after loading -- before raster mode's resampling -- and report the
last available date instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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