home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where issue = 337733183 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 3

  • NickMortimer 2
  • jhamman 1
  • spencerkclark 1

author_association 2

  • MEMBER 2
  • NONE 2

issue 1

  • .to_zarr with datetime64[ns] · 4 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
402327882 https://github.com/pydata/xarray/issues/2265#issuecomment-402327882 https://api.github.com/repos/pydata/xarray/issues/2265 MDEyOklzc3VlQ29tbWVudDQwMjMyNzg4Mg== NickMortimer 4338975 2018-07-04T00:25:33Z 2018-07-04T00:25:33Z NONE

@jhamman thanks I'll add to the discussion there and close this issue.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  .to_zarr with datetime64[ns] 337733183
402216978 https://github.com/pydata/xarray/issues/2265#issuecomment-402216978 https://api.github.com/repos/pydata/xarray/issues/2265 MDEyOklzc3VlQ29tbWVudDQwMjIxNjk3OA== jhamman 2443309 2018-07-03T16:30:06Z 2018-07-03T16:30:06Z MEMBER

Is there a way of appending an xarray dataset onto an existing zarr array?

@NickMortimer - No, not yet. It has been proposed already though in #2022.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  .to_zarr with datetime64[ns] 337733183
402155326 https://github.com/pydata/xarray/issues/2265#issuecomment-402155326 https://api.github.com/repos/pydata/xarray/issues/2265 MDEyOklzc3VlQ29tbWVudDQwMjE1NTMyNg== NickMortimer 4338975 2018-07-03T13:22:24Z 2018-07-03T13:24:04Z NONE

@spencerkclark yes that helps very much and a great example of how to answer a question! I'm learning so much from this group. Is there a way of appending an xarray dataset onto an existing zarr array? That's why I've been accessing direct through zarr, what I'm trying to do is build a zarr file of all the Argo float profiles and add new ones as they arrive.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  .to_zarr with datetime64[ns] 337733183
402131750 https://github.com/pydata/xarray/issues/2265#issuecomment-402131750 https://api.github.com/repos/pydata/xarray/issues/2265 MDEyOklzc3VlQ29tbWVudDQwMjEzMTc1MA== spencerkclark 6628425 2018-07-03T12:05:37Z 2018-07-03T12:05:37Z MEMBER

When writing datetime objects to disk, xarray encodes them following CF conventions (converting them to numerical values quantifying some units of time since a given reference date). This is to support other backends which do not support writing datetime64 objects directly to disk.

For accurate roundtripping of Datasets, xarray also includes logic to automatically decode datetimes stored following CF conventions. For that reason, instead of loading in the raw zarr store using zarr's open function, I recommend using xarray's open_zarr function, which will automatically decode the CF-encoded values to datetime64 objects.

See the following example: ``` In [1]: import numpy as np

In [2]: import xarray as xr

In [3]: da = xr.DataArray(np.datetime64('2000-01-01'), name='date')

In [4]: da Out[4]: <xarray.DataArray 'date' ()> array('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]')

In [5]: da.to_dataset().to_zarr('example.zarr') Out[5]: <xarray.backends.zarr.ZarrStore at 0x1109ca190>

In [6]: ds = xr.open_zarr('example.zarr')

In [7]: ds.date Out[7]: <xarray.DataArray 'date' ()> array('2000-01-01T00:00:00.000000000', dtype='datetime64[ns]') Note if we open the zarr store directly, we'll find that the date was encoded with the integer `0` and appropriate units and calendar attributes: In [1]: import zarr

In [2]: z = zarr.open('example.zarr')

In [3]: z['date'][...] Out[3]: array(0)

In [4]: z['date'].attrs['units'] Out[4]: u'days since 2000-01-01 00:00:00'

In [5]: z['date'].attrs['calendar'] Out[5]: u'proleptic_gregorian' ``` Unlike xarray, zarr does not include logic for automatically decoding CF-encoded datetimes. I hope that helps.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  .to_zarr with datetime64[ns] 337733183

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