iris icon indicating copy to clipboard operation
iris copied to clipboard

Errors caused by times not convertible to datetime

Open stephenworsley opened this issue 2 years ago • 3 comments

🐛 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: https://github.com/SciTools/iris/blob/b2b4e3ba89a745f851c4d724c137b3f4e4641f92/lib/iris/coords.py#L2166-L2169

stephenworsley avatar Apr 05 '23 13:04 stephenworsley

bug_ncdump.txt

ncdump of file in question that gives this error

acchamber avatar Apr 05 '23 13:04 acchamber

Think https://github.com/SciTools/cf-units/pull/279 may be relevant here.

rcomer avatar Apr 05 '23 14:04 rcomer

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[bot] avatar Aug 18 '24 00:08 github-actions[bot]

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[bot] avatar Sep 15 '24 00:09 github-actions[bot]