home / github

Menu
  • GraphQL API
  • Search all tables

issue_comments

Table actions
  • GraphQL API for issue_comments

9 rows where author_association = "MEMBER" and issue = 168243768 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

  • shoyer 5
  • max-sixty 3
  • jhamman 1

issue 1

  • Inconsistency between the types of Dataset.dims and DataArray.dims · 9 ✖

author_association 1

  • MEMBER · 9 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
457745979 https://github.com/pydata/xarray/issues/921#issuecomment-457745979 https://api.github.com/repos/pydata/xarray/issues/921 MDEyOklzc3VlQ29tbWVudDQ1Nzc0NTk3OQ== shoyer 1217238 2019-01-25T22:01:46Z 2019-01-25T22:01:46Z MEMBER

We have .sizes now.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Inconsistency between the types of Dataset.dims and DataArray.dims 168243768
255497739 https://github.com/pydata/xarray/issues/921#issuecomment-255497739 https://api.github.com/repos/pydata/xarray/issues/921 MDEyOklzc3VlQ29tbWVudDI1NTQ5NzczOQ== shoyer 1217238 2016-10-22T01:08:52Z 2016-10-22T01:08:52Z MEMBER

With optional indexes (#1017) meaning that ds.coords[...].size may not always succeed (OK, depending on some implementation choices), the need for a consistent way to look up dimension sizes becomes even more severe.

Rather than resolving the type inconsistency of dims, we could simply add a new attribute sizes to both Dataset and DataArray that is exactly equivalent to Dataset.dims. The Dataset API ends up a little bit redundant, but we have a consistent way to access this information.

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Inconsistency between the types of Dataset.dims and DataArray.dims 168243768
237250366 https://github.com/pydata/xarray/issues/921#issuecomment-237250366 https://api.github.com/repos/pydata/xarray/issues/921 MDEyOklzc3VlQ29tbWVudDIzNzI1MDM2Ng== jhamman 2443309 2016-08-03T14:20:02Z 2016-08-03T14:20:02Z MEMBER

It seems to me that xarray has the same convention for dims that netCDF4 has for dimensions, OrderedDict for the dataset, tuple for the variables (DataArrays).

I do see the utility in switching to an OrderedDict for both. I have had times where I need to know the size of a dimension on a data array and as @shoyer mentioned, its a bit of a hunt at the moment. That would be my vote if we're willing to make that breaking change.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Inconsistency between the types of Dataset.dims and DataArray.dims 168243768
237163191 https://github.com/pydata/xarray/issues/921#issuecomment-237163191 https://api.github.com/repos/pydata/xarray/issues/921 MDEyOklzc3VlQ29tbWVudDIzNzE2MzE5MQ== shoyer 1217238 2016-08-03T07:26:29Z 2016-08-03T07:26:29Z MEMBER

One thing I like about dims being a frozen dictionary is that is makes the fixed, immutable nature of dimension sizes on the Dataset very obvious in the data model. If you had to use ds.coords[...].size to look up dimension sizes, this would be much less obvious.

CC @jhamman in case he has thoughts here.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Inconsistency between the types of Dataset.dims and DataArray.dims 168243768
236271882 https://github.com/pydata/xarray/issues/921#issuecomment-236271882 https://api.github.com/repos/pydata/xarray/issues/921 MDEyOklzc3VlQ29tbWVudDIzNjI3MTg4Mg== max-sixty 5635139 2016-07-29T19:26:50Z 2016-07-29T19:26:50Z MEMBER

Thanks for the, as ever, thoughtful response

Should we move Dataset.dims to be a tuple, then?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Inconsistency between the types of Dataset.dims and DataArray.dims 168243768
236235255 https://github.com/pydata/xarray/issues/921#issuecomment-236235255 https://api.github.com/repos/pydata/xarray/issues/921 MDEyOklzc3VlQ29tbWVudDIzNjIzNTI1NQ== shoyer 1217238 2016-07-29T17:00:24Z 2016-07-29T17:00:24Z MEMBER

I frequently need to pull out the dimension names, and I've never needed to pull out their sizes.

Indeed, this is why this discrepancy has survived for so long. Both 'foo' in x and iterations over x work the same for dictionary keys and tuples (thanks to duck typing).

Zooming out a bit: the access pattern for most of these (variables, coords) is indeed an OrderedDict of name to object. But the stickler for dim is why the size should be the value here? It seems very different from having dim objects as values.

Agreed, it is a little weird, and probably unnecessary. It is arguably a left-over from the very early days of xarray (before we had a DataArray type!).

It occurs to me that it's not hard to pull sizes out of ds.coords['time'].size if necessary, and that's probably totally sufficient for getting dimension sizes for both DataArray and Dataset. We don't really need dims_shape.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Inconsistency between the types of Dataset.dims and DataArray.dims 168243768
236224041 https://github.com/pydata/xarray/issues/921#issuecomment-236224041 https://api.github.com/repos/pydata/xarray/issues/921 MDEyOklzc3VlQ29tbWVudDIzNjIyNDA0MQ== max-sixty 5635139 2016-07-29T16:15:03Z 2016-07-29T16:15:03Z MEMBER

I frequently need to pull out the dimension names, and I've never needed to pull out their sizes. I realize that the internals need to do that though. And maybe my use case is specific.

Zooming out a bit: the access pattern for most of these (variables, coords) is indeed an OrderedDict of name to object. But the stickler for dim is why the size should be the value here? It seems very different from having dim objects as values.

I could certainly understand a convenience dims_shape (for {dim: ds[dim].shape for dim in ds.dims}.

But I"m coming from a place of less context without that much confidence...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Inconsistency between the types of Dataset.dims and DataArray.dims 168243768
236097486 https://github.com/pydata/xarray/issues/921#issuecomment-236097486 https://api.github.com/repos/pydata/xarray/issues/921 MDEyOklzc3VlQ29tbWVudDIzNjA5NzQ4Ng== shoyer 1217238 2016-07-29T05:26:22Z 2016-07-29T05:26:22Z MEMBER

What are the arguments against having dims be a tuple for both DataArray & Datasets?

I guess that's a third option! In that case, we'd have to add shape to Dataset, too, to ensure there is some way to get size information.

The main downside is that we'd still be stuck without any idea way to get dimension sizes by name -- ds.shape[ds.get_axis_num('time')] is pretty bad. Also, I'm not sure how many use cases there are for actually pulling out the first dimension of a dataset (or it's shape) by position, given that dimension order is currently sorted independently of dimension order on any of its data arrays.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Inconsistency between the types of Dataset.dims and DataArray.dims 168243768
236093456 https://github.com/pydata/xarray/issues/921#issuecomment-236093456 https://api.github.com/repos/pydata/xarray/issues/921 MDEyOklzc3VlQ29tbWVudDIzNjA5MzQ1Ng== max-sixty 5635139 2016-07-29T04:45:32Z 2016-07-29T04:45:32Z MEMBER

What are the arguments against having dims be a tuple for both DataArray & Datasets?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  Inconsistency between the types of Dataset.dims and DataArray.dims 168243768

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