home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 173773358 and user = 3404817 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

  • j08lue · 6 ✖

issue 1

  • Creating unlimited dimensions with xarray.Dataset.to_netcdf · 6 ✖

author_association 1

  • CONTRIBUTOR 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
258949295 https://github.com/pydata/xarray/issues/992#issuecomment-258949295 https://api.github.com/repos/pydata/xarray/issues/992 MDEyOklzc3VlQ29tbWVudDI1ODk0OTI5NQ== j08lue 3404817 2016-11-07T20:14:37Z 2016-11-07T20:14:37Z CONTRIBUTOR

Great to see you are pushing forward on this issue @jhamman and @shoyer. I would really have liked to contribute here, but it seems like there are quite some design choices to make, which are better left in your hands.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Creating unlimited dimensions with xarray.Dataset.to_netcdf 173773358
243367823 https://github.com/pydata/xarray/issues/992#issuecomment-243367823 https://api.github.com/repos/pydata/xarray/issues/992 MDEyOklzc3VlQ29tbWVudDI0MzM2NzgyMw== j08lue 3404817 2016-08-30T08:22:32Z 2016-08-30T08:22:32Z CONTRIBUTOR

@jhamman sorry, I only now saw that you pointed to a previous issue on the same topic (with exactly the same considerations). I did not find that issue when I searched (for "unlimited").

You were against changing to_netcdf then. Are you still?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Creating unlimited dimensions with xarray.Dataset.to_netcdf 173773358
243365966 https://github.com/pydata/xarray/issues/992#issuecomment-243365966 https://api.github.com/repos/pydata/xarray/issues/992 MDEyOklzc3VlQ29tbWVudDI0MzM2NTk2Ng== j08lue 3404817 2016-08-30T08:14:08Z 2016-08-30T08:14:08Z CONTRIBUTOR

The above solution would not require much more than that, in set_necessary_dimensions,

def set_necessary_dimensions(self, variable): for d, l in zip(variable.dims, variable.shape): if d not in self.dimensions: self.set_dimension(d, l)

would become

def set_necessary_dimensions(self, variable): for d, l in zip(variable.dims, variable.shape): if d in self._unlimited_dimensions: l = None if d not in self.dimensions: self.set_dimension(d, l)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Creating unlimited dimensions with xarray.Dataset.to_netcdf 173773358
243364284 https://github.com/pydata/xarray/issues/992#issuecomment-243364284 https://api.github.com/repos/pydata/xarray/issues/992 MDEyOklzc3VlQ29tbWVudDI0MzM2NDI4NA== j08lue 3404817 2016-08-30T08:06:49Z 2016-08-30T08:07:07Z CONTRIBUTOR

But maybe the encoding dict is not the way to go after all, since it contains entries per variable, while it is the dimension that must be unlimited.

Currently the dataset variables can be created in any order and their necessary dimensions created whenever needed (in the set_necessary_dimensions function). I would not like to change that logic (e.g. towards creating all dimensions required by all variables first, before adding the data variables).

So how about a new kw argument to to_netcdf, like

ds.to_netcdf(unlimited_dimensions=['time'])

or

ds.to_netcdf(dimension_unlimited={'time': True})

(the second option better for explicitly setting {'time': False})?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Creating unlimited dimensions with xarray.Dataset.to_netcdf 173773358
243350429 https://github.com/pydata/xarray/issues/992#issuecomment-243350429 https://api.github.com/repos/pydata/xarray/issues/992 MDEyOklzc3VlQ29tbWVudDI0MzM1MDQyOQ== j08lue 3404817 2016-08-30T06:59:14Z 2016-08-30T06:59:14Z CONTRIBUTOR

I think it makes sense to preserve the UNLIMITED state through read/write. In my case, I subset a netCDF file along lat and lon dimensions, leaving the time dimension untouched and would therefore expect it to pass unchanged through xarray IO (staying UNLIMITED).

However, when the dataset is indexed/subset/resampled along the unlimited dimension, it would make sense that its state is dropped. But that would require a lot of ifs and buts, so I suggest we leave that aside for now.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Creating unlimited dimensions with xarray.Dataset.to_netcdf 173773358
243253510 https://github.com/pydata/xarray/issues/992#issuecomment-243253510 https://api.github.com/repos/pydata/xarray/issues/992 MDEyOklzc3VlQ29tbWVudDI0MzI1MzUxMA== j08lue 3404817 2016-08-29T20:56:55Z 2016-08-29T20:56:55Z CONTRIBUTOR

OK, I'd be up for taking a shot at it.

Since it is per-variable and specific to netCDF, I guess the perfect place to add this is in the encoding dictionary that you can pass to to_netcdf, right? Maybe as key unlimited? E.g.

ds.to_netcdf(encoding={'time': dict(unlimited=True)})

I need to look up whether netCDF allows for defining more than one unlimited dimension, otherwise that must throw an error.

And then it is just about passing None as length to CreateDimension, at least in netCDF4 and scipy.io.netcdf. But I did not look into how xarray handles that under the hood.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Creating unlimited dimensions with xarray.Dataset.to_netcdf 173773358

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