clip_timerange
gives the wrong end date if ending not on the 31st of December
#2489
Labels
bear at a dinner party
Something very unexpected
bug
Something isn't working
preprocessor
Related to the preprocessor
While working on #2304, I've discovered that
clip_timerange
would give you a wrong end date if theend_day
andend_month
aren't the 31st of December. Example, I need to process ERA5 data for the current year which ends on the 18th of July of 2024. Out of fun I'm passing the 17th of July 2024 as an end date, example:Now, what I would expect, the cube to be cropped to 2024-01-01 - 2024-07-17, but because the
timerange
that gets passed into theclip_timerange(cube: Cube, timerange: str)
is2024/2024
, the cube gets to be clipped to 2024-01-01 - 2025-01-01. While I can see that the described use case might be more on a rare side, I think it's still important to be fixed.Pinging @bouweandela, since he wrote a bunch of time preprocessors.
The text was updated successfully, but these errors were encountered: