home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 58537752

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
58537752 MDExOlB1bGxSZXF1ZXN0Mjk3ODM4Njc= 330 Improved error handling for datetime decoding errors 1217238 closed 0   799013 0 2015-02-23T03:08:40Z 2015-02-25T22:00:36Z 2015-02-23T03:11:03Z MEMBER   0 pydata/xarray/pulls/330

Fixes #323

We now get an error message with a lovely traceback when opening a dataset with invalid time units. For example:

Traceback (most recent call last): File "/Users/shoyer/dev/xray/xray/test/test_conventions.py", line 340, in test_invalid_units_raises_eagerly decode_cf(ds) File "/Users/shoyer/dev/xray/xray/conventions.py", line 775, in decode_cf decode_coords) File "/Users/shoyer/dev/xray/xray/conventions.py", line 716, in decode_cf_variables decode_times=decode_times) File "/Users/shoyer/dev/xray/xray/conventions.py", line 676, in decode_cf_variable data = DecodedCFDatetimeArray(data, units, calendar) File "/Users/shoyer/dev/xray/xray/conventions.py", line 340, in __init__ raise ValueError(msg) ValueError: unable to decode time units 'foobar since 123' with the default calendar. Try opening your dataset with decode_times=False. Full traceback: Traceback (most recent call last): File "/Users/shoyer/dev/xray/xray/conventions.py", line 331, in __init__ decode_cf_datetime(example_value, units, calendar) File "/Users/shoyer/dev/xray/xray/conventions.py", line 130, in decode_cf_datetime delta = _netcdf_to_numpy_timeunit(delta) File "/Users/shoyer/dev/xray/xray/conventions.py", line 72, in _netcdf_to_numpy_timeunit return {'seconds': 's', 'minutes': 'm', 'hours': 'h', 'days': 'D'}[units] KeyError: 'foobars'

Also includes a fix for a datetime decoding issue reported on the mailing list: https://groups.google.com/forum/#!topic/xray-dev/Sscsw5dQAqQ

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/330/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 pull

Links from other tables

  • 1 row from issues_id in issues_labels
  • 0 rows from issue in issue_comments
Powered by Datasette · Queries took 0.745ms · About: xarray-datasette