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

Errors caused by times not convertible to datetime #5237

Closed
stephenworsley opened this issue Apr 5, 2023 · 4 comments
Closed

Errors caused by times not convertible to datetime #5237

stephenworsley opened this issue Apr 5, 2023 · 4 comments
Labels
Stale A stale issue/pull-request Type: Bug

Comments

@stephenworsley
Copy link
Contributor

stephenworsley commented Apr 5, 2023

🐛 Bug Report

Time coordinates can sometimes have units which will cause an error when you try and convert thier points to datetimes. For example, when the units are in "years since date" format. This causes an error when plotting against this time axis or when printing a cube with a scalar coordinate of this form. In such cases, it might be appropriate to represent the raw points (and raising a warning) rather than failing outright.

This could potentially by solved by adding try/except in places like here:

iris/lib/iris/coords.py

Lines 2166 to 2169 in b2b4e3b

if self.units.is_time_reference():
point = self.units.num2date(point)
if bound is not None:
bound = self.units.num2date(bound)

@acchamber
Copy link
Contributor

bug_ncdump.txt

ncdump of file in question that gives this error

@rcomer
Copy link
Member

rcomer commented Apr 5, 2023

Think SciTools/cf-units#279 may be relevant here.

Copy link
Contributor

In order to maintain a backlog of relevant issues, we automatically label them as stale after 500 days of inactivity.

If this issue is still important to you, then please comment on this issue and the stale label will be removed.

Otherwise this issue will be automatically closed in 28 days time.

@github-actions github-actions bot added the Stale A stale issue/pull-request label Aug 18, 2024
Copy link
Contributor

This stale issue has been automatically closed due to a lack of community activity.

If you still care about this issue, then please either:

  • Re-open this issue, if you have sufficient permissions, or
  • Add a comment stating that this is still relevant and someone will re-open it on your behalf.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale A stale issue/pull-request Type: Bug
Projects
Status: Done
Development

No branches or pull requests

3 participants