cfgrib
cfgrib copied to clipboard
Explicitly request value for 'endStep' as integer
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
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.
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.
Thanks @Metamess, this was an important fix to get into cfgrib