-
Notifications
You must be signed in to change notification settings - Fork 280
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
Printing time coordinates with long time intervals #3098
Comments
@PAGWatson is this the same as what you've seen? |
Thanks for following up on this. This is not quite the issue I had. I found that for a cube with a time coord with units in months, I got the following error message when I tried to print the coordinate: "ValueError: Time units with interval of "months", "years" (or singular of these) cannot be processed, got 'months'." This was in Iris 2.1.0. |
@PAGWatson could you check the version of |
Mine is 2.0.1 |
Interesting. Having upgraded |
Sure, here it is:
If I just type "cube.coord('time')[0]" rather than "print cube.coord('time')[0]" at the command prompt, I get the following, in case that's any help:
|
@PAGWatson I think I've figured it out (with help from the stacktrace you provided - thanks!). The error is occurring when the time coordinate has bounds, and that gives us something to target a fix for. Edit: really, we should have handled bounds equivalently to points way back in #2354. We didn't, so it must be time to correct that. PR incoming. |
For what it's worth, the origin of this issue is in |
Thanks for following up @dkillick. I guess if there's not an accepted way to handle converting times with units months or years to dates, then it might make sense to just leave the values as numbers, so at least an error isn't thrown? We can't always help the units used in files we get from other sources, of course. |
@PAGWatson yup, that's my intention, at least as an interim solution 👍 There is probably a better, more robust solution that can be implemented long-term (perhaps even in |
If you print a coordinate with a long time unit interval (one of
months
oryears
), the time coordinate points are not rendered as datetimes. This is not the case for shorter time unit intervals. For example:Follows on from #2354. Thanks to @PAGWatson for originally bringing this to our attention there.
The text was updated successfully, but these errors were encountered: