Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly request value for 'endStep' as integer #371

Merged
merged 6 commits into from
Apr 23, 2024

Conversation

Metamess
Copy link
Contributor

Closes #370

This simple PR adds explicitly requesting an integer value from the ecCodes framework when reading the value for "endStep". This is done by leveraging the built-in support for this in the getitem of the Message class, which will attempt to partition a key formatted as key:key_type

@iainrussell
Copy link
Member

Sorry for the big delay in looking at this, @Metamess, I've just been crazy busy! Thank you for your contribution. I've set the ci going now.

@iainrussell
Copy link
Member

I've made some adjustments here because the suggested fix was not working by itself. Ultimately, cfgrib is always converting steps into hours (ideally it should be a shorter time increment, but that will come later). So I've ensured that we always ensure that the index knows that the units are hours rather than the encoded step units. That fixes the problem where we have a file (such as the sample file I added) where we have 0 and 60 minutes, which ecCodes returns as 0m and 1h respectively, and cfgrib does not recognise as a valid hypercube.

@iainrussell iainrussell merged commit 50bb9bf into ecmwf:master Apr 23, 2024
6 checks passed
@iainrussell
Copy link
Member

Thanks @Metamess, this was an important fix to get into cfgrib

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.

Unable to read "step" with ecCodes 2.34.0
2 participants