home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where author_association = "MEMBER" and issue = 383791450 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: reactions, created_at (date), updated_at (date)

user 3

  • fmaussion 2
  • shoyer 1
  • spencerkclark 1

issue 1

  • CF conventions: time_bnds and time units · 4 ✖

author_association 1

  • MEMBER · 4 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
441333644 https://github.com/pydata/xarray/issues/2565#issuecomment-441333644 https://api.github.com/repos/pydata/xarray/issues/2565 MDEyOklzc3VlQ29tbWVudDQ0MTMzMzY0NA== shoyer 1217238 2018-11-24T00:48:28Z 2018-11-24T00:48:28Z MEMBER

You can find the decoded time units in encoding: In [8]: ds.time.encoding['units'] Out[8]: 'days since 0850-01-01 00:00:00'

But I would also be in favor of decoding time units in bounds variables.

{
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF conventions: time_bnds and time units  383791450
441228064 https://github.com/pydata/xarray/issues/2565#issuecomment-441228064 https://api.github.com/repos/pydata/xarray/issues/2565 MDEyOklzc3VlQ29tbWVudDQ0MTIyODA2NA== fmaussion 10050469 2018-11-23T12:23:00Z 2018-11-23T12:24:17Z MEMBER

Good points!

I do notice the time variable in your file has a bounds attribute, which points to the name time_bnds. Is that something required by CF conventions? We might be able to rely on that.

Yes, bounds is a CF name: http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/cf-conventions.html#cell-boundaries

It seems reasonable to assume that the bounds should share the same units as time, therefore I think that the workaround you are using could actually be implemented in xarray, but the actual implementation might be a bit messy...

(it would be much simpler if CF would prescribe the units to also be available at the the time_bnds level...)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF conventions: time_bnds and time units  383791450
441226736 https://github.com/pydata/xarray/issues/2565#issuecomment-441226736 https://api.github.com/repos/pydata/xarray/issues/2565 MDEyOklzc3VlQ29tbWVudDQ0MTIyNjczNg== spencerkclark 6628425 2018-11-23T12:15:36Z 2018-11-23T12:15:36Z MEMBER

@fmaussion I have run into this issue before and it is a bit cumbersome. My workaround in the past has been to open the dataset without decoding the times initially, copy the units and calendar attributes from the time variable to the time_bnds variable, and then decode the times (xarray will decode any variable with a time-like units attribute into dates, regardless of its name).

``` In [1]: import xarray

In [2]: ds = xarray.open_dataset('cesm.TREFHT.160001-200512.selection.nc', decode_times=False)

In [3]: ds.time_bnds.attrs['units'] = ds.time.attrs['units']

In [4]: ds.time_bnds.attrs['calendar'] = ds.time.attrs['calendar']

In [5]: ds_decoded = xarray.decode_cf(ds) ```

I am actually in favor of 3: also decode time_bnds

It would be nice if we could handle this automatically, though one issue that concerns me is how we would automatically determine which variable represents the time bounds in an arbitrary netCDF file (as mentioned above we currently do not have any variable-name-specific logic in xarray, which I think is a good thing). I do notice the time variable in your file has a bounds attribute, which points to the name time_bnds. Is that something required by CF conventions? We might be able to rely on that.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF conventions: time_bnds and time units  383791450
441222614 https://github.com/pydata/xarray/issues/2565#issuecomment-441222614 https://api.github.com/repos/pydata/xarray/issues/2565 MDEyOklzc3VlQ29tbWVudDQ0MTIyMjYxNA== fmaussion 10050469 2018-11-23T11:54:14Z 2018-11-23T11:54:14Z MEMBER

I am actually in favor of 3: also decode time_bnds

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  CF conventions: time_bnds and time units  383791450

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
);
CREATE INDEX [idx_issue_comments_issue]
    ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
    ON [issue_comments] ([user]);
Powered by Datasette · Queries took 12.525ms · About: xarray-datasette