home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

7 rows where author_association = "CONTRIBUTOR", issue = 207011524 and user = 5700886 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • willirath · 7 ✖

issue 1

  • Allow for plotting dummy netCDF4.datetime objects. · 7 ✖

author_association 1

  • CONTRIBUTOR · 7 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
284397545 https://github.com/pydata/xarray/pull/1261#issuecomment-284397545 https://api.github.com/repos/pydata/xarray/issues/1261 MDEyOklzc3VlQ29tbWVudDI4NDM5NzU0NQ== willirath 5700886 2017-03-06T13:37:33Z 2017-03-06T13:37:33Z CONTRIBUTOR

Yes, I know that xarray usually doesn't use datetime. For climate data past 2262 with a standard calendar, however, the dtypes of the time axis are falling back to datetime / netCDF4.datetime.

My last commit reflects what I'd consider ready to be pulled. Let me know what you think.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow for plotting dummy netCDF4.datetime objects. 207011524
279467664 https://github.com/pydata/xarray/pull/1261#issuecomment-279467664 https://api.github.com/repos/pydata/xarray/issues/1261 MDEyOklzc3VlQ29tbWVudDI3OTQ2NzY2NA== willirath 5700886 2017-02-13T17:50:13Z 2017-02-13T17:50:13Z CONTRIBUTOR

netcdftime.datetime vs. datetime.datetime is discussed in Unidata/netcdftime#8. For now, I only added datetime.datetime to the list of plottable other types (see https://github.com/willirath/xarray/blob/6f5e30f3a2f8ca907f0fd91bcd571e7d98027896/xarray/plot/plot.py#L52).

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow for plotting dummy netCDF4.datetime objects. 207011524
279459572 https://github.com/pydata/xarray/pull/1261#issuecomment-279459572 https://api.github.com/repos/pydata/xarray/issues/1261 MDEyOklzc3VlQ29tbWVudDI3OTQ1OTU3Mg== willirath 5700886 2017-02-13T17:21:37Z 2017-02-13T17:26:12Z CONTRIBUTOR

a85b5c6 and e31aaab add a test plotting against a coordinate with netCDF4.datetime objects.

6f5e30f adds datetime.datetime objects to the list of plottable dtypes and splits the check into numpy dtypes (using numpy's type hierarchy) and all other types.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow for plotting dummy netCDF4.datetime objects. 207011524
279186528 https://github.com/pydata/xarray/pull/1261#issuecomment-279186528 https://api.github.com/repos/pydata/xarray/issues/1261 MDEyOklzc3VlQ29tbWVudDI3OTE4NjUyOA== willirath 5700886 2017-02-12T00:26:59Z 2017-02-13T17:25:32Z CONTRIBUTOR
  • [x] Add tests showing that netcdftime.datetime objects can be plotted (line and 2d plots).
  • [x] Rewrite xarray.plot._ensure_plottable to only let numeric and date-like types pass.
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow for plotting dummy netCDF4.datetime objects. 207011524
279340528 https://github.com/pydata/xarray/pull/1261#issuecomment-279340528 https://api.github.com/repos/pydata/xarray/issues/1261 MDEyOklzc3VlQ29tbWVudDI3OTM0MDUyOA== willirath 5700886 2017-02-13T09:54:30Z 2017-02-13T09:54:30Z CONTRIBUTOR

Does matplotlib actually plot netcdftime datetimes correctly?

Yes it does. They are just treated like datetime.datetime objects.

I was wrong here: netCDF4.datetime is datetime.datetime while (netcdftime.datetime is DatetimeProlepticGregorian.

And matplotlib fails on the latter: https://gist.github.com/willirath/48c04db0481e986fac0e44549e164ab0

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow for plotting dummy netCDF4.datetime objects. 207011524
279185373 https://github.com/pydata/xarray/pull/1261#issuecomment-279185373 https://api.github.com/repos/pydata/xarray/issues/1261 MDEyOklzc3VlQ29tbWVudDI3OTE4NTM3Mw== willirath 5700886 2017-02-12T00:03:26Z 2017-02-12T00:03:26Z CONTRIBUTOR

Does matplotlib actually plot netcdftime datetimes correctly?

Yes it does. They are just treated like datetime.datetime objects.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow for plotting dummy netCDF4.datetime objects. 207011524
279185264 https://github.com/pydata/xarray/pull/1261#issuecomment-279185264 https://api.github.com/repos/pydata/xarray/issues/1261 MDEyOklzc3VlQ29tbWVudDI3OTE4NTI2NA== willirath 5700886 2017-02-12T00:01:21Z 2017-02-12T00:01:21Z CONTRIBUTOR

Failing tests: xarray/tests/test_plot.py::TestPlot1D::test_nonnumeric_index_raises_typeerror FAILED xarray/tests/test_plot.py::TestContourf::test_nonnumeric_index_raises_typeerror FAILED xarray/tests/test_plot.py::TestContour::test_nonnumeric_index_raises_typeerror FAILED xarray/tests/test_plot.py::TestPcolormesh::test_nonnumeric_index_raises_typeerror FAILED xarray/tests/test_plot.py::TestImshow::test_nonnumeric_index_raises_typeerror FAIL

All of these check strings as input to the plot functions and expect a TypeError.

xarray.plot._right_dtype, however, uses numpy.issubdtype to check, if the types of the given data are subtypes of the now included netCDF4.datetime, which is interpreted as numpy.generic. And as numpy.generic is the highest type in Numpy's type hierarchy, xarray.plot._right_dtype now always returns True.

A possible way out would be to check for numeric types and datetime-like types separately.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Allow for plotting dummy netCDF4.datetime objects. 207011524

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 560.227ms · About: xarray-datasette