home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

6 rows where issue = 420930870 and user = 1217238 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 1

  • shoyer · 6 ✖

issue 1

  • concat changes variable order · 6 ✖

author_association 1

  • MEMBER 6
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
473758690 https://github.com/pydata/xarray/issues/2811#issuecomment-473758690 https://api.github.com/repos/pydata/xarray/issues/2811 MDEyOklzc3VlQ29tbWVudDQ3Mzc1ODY5MA== shoyer 1217238 2019-03-18T03:37:08Z 2019-03-18T03:37:08Z MEMBER

see https://github.com/pydata/xarray/pull/2818 for removing that warning

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  concat changes variable order 420930870
473752674 https://github.com/pydata/xarray/issues/2811#issuecomment-473752674 https://api.github.com/repos/pydata/xarray/issues/2811 MDEyOklzc3VlQ29tbWVudDQ3Mzc1MjY3NA== shoyer 1217238 2019-03-18T03:01:44Z 2019-03-18T03:01:44Z MEMBER

That warning should be removed — we already finished that deprecation cycle!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  concat changes variable order 420930870
473359624 https://github.com/pydata/xarray/issues/2811#issuecomment-473359624 https://api.github.com/repos/pydata/xarray/issues/2811 MDEyOklzc3VlQ29tbWVudDQ3MzM1OTYyNA== shoyer 1217238 2019-03-15T16:44:40Z 2019-03-15T16:44:40Z MEMBER

This is due to the internal implementation of xarray.concat, which sometimes reorders variables. I doubt the reordering was intentional. It's probably just a side effect of how concat takes multiple passes over different types of variables to figure out how to combine them.

You are welcome to take a look at improving this, though I doubt this would be particularly easy to fix. Certainly the code in concat could use some clean-up, and if we can preserve the order of variables on outputs that would be an improvement in usability. But it's still not something I would consider a "bug" per se.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  concat changes variable order 420930870
473331876 https://github.com/pydata/xarray/issues/2811#issuecomment-473331876 https://api.github.com/repos/pydata/xarray/issues/2811 MDEyOklzc3VlQ29tbWVudDQ3MzMzMTg3Ng== shoyer 1217238 2019-03-15T15:31:23Z 2019-03-15T15:31:23Z MEMBER

I was assuming something along that lines. But in my variable test the 'c' dim is first. And it is written correctly, if there are no coordinates in that dataset (test_dim0). If there are coordinates (test_dims2) the dimensions are written in wrong order. So there is something working in one config and not in the other.

The order of dimensions in the netCDF file matches the order of their appearance on variables in the netCDF files. In your first file, it's (c, b) on variable test. In the second file, it's b on variable b and c from variable test.

My use case is, that the dimensions should appear in the same order as in the source files.

Sorry, xarray is not going to satisfy this use. If you want this guarantee in all cases, you should pick a different tool.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  concat changes variable order 420930870
473319350 https://github.com/pydata/xarray/issues/2811#issuecomment-473319350 https://api.github.com/repos/pydata/xarray/issues/2811 MDEyOklzc3VlQ29tbWVudDQ3MzMxOTM1MA== shoyer 1217238 2019-03-15T14:59:19Z 2019-03-15T14:59:19Z MEMBER

Dimensions are written to netCDF files in the order in which they appear on variables in the Dataset: https://github.com/pydata/xarray/blob/f382fd840dafa5fdd95e66a7ddd15a3d498c1bce/xarray/backends/common.py#L325-L329

It sounds like your use-case is writing netCDF files to disk with a desired dimension order? We could conceivably add an "encoding" option to datasets for specifying dimension order, like how we support controlling unlimited dimensions.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  concat changes variable order 420930870
473183599 https://github.com/pydata/xarray/issues/2811#issuecomment-473183599 https://api.github.com/repos/pydata/xarray/issues/2811 MDEyOklzc3VlQ29tbWVudDQ3MzE4MzU5OQ== shoyer 1217238 2019-03-15T07:19:18Z 2019-03-15T07:19:18Z MEMBER

Your system might print dataset dimensions like Frozen(SortedKeysDict({'c': 2, 'b': 3})), but the iteration order will always be sorted (including if you write the dataset to disk as netcdf file).

When we drop support for Python 3.5, xarray might switch to dimensions matching order of insertion, since we'll get that for free with Python dictionary. But I still doubt we would make any guarantees about preserving dimension order in xarray operations, just like we don't guarantee variable order as part of xarray's API. It should be deterministic (with fixed versions of xarray and dependencies), but you shouldn't write your code in a way that breaks if changes.

What's your actual use-case here? What are you trying to do that needs preserving of dimension order?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  concat changes variable order 420930870

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