issue_comments
12 rows where author_association = "MEMBER", issue = 420930870 and user = 5821660 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- concat changes variable order · 12 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
473829894 | https://github.com/pydata/xarray/issues/2811#issuecomment-473829894 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3MzgyOTg5NA== | kmuehlbauer 5821660 | 2019-03-18T09:19:14Z | 2019-03-18T09:19:14Z | MEMBER | After checking a bit more in older issues, this seems related: https://github.com/pydata/xarray/pull/1049, ping @fmaussion. And also @shoyer's comment suggest that those two iterations/loops I mentioned above need to be addressed correctly. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
concat changes variable order 420930870 | |
473810333 | https://github.com/pydata/xarray/issues/2811#issuecomment-473810333 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3MzgxMDMzMw== | kmuehlbauer 5821660 | 2019-03-18T08:13:47Z | 2019-03-18T08:13:47Z | MEMBER | @shoyer Attached the description of the issue source and kind of workaround. During After several checks the affected variables are treated and added to The comment indicates what you already mentioned, that the reorder might be unintentional. But due to the handling in two separate iterations over This can be worked around by changing the second iteration to: ```python re-initialize result_vars to write in correct orderresult_vars = OrderedDict() stack up each variable to fill-out the dataset (in order)for k in datasets[0].variables:
if k in concat_over:
vars = ensure_common_dims([ds.variables[k] for ds in datasets])
combined = concat_vars(vars, dim, positions)
insert_result_variable(k, combined)
else:
insert_result_variable(k, datasets[0].variables[k]) |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
concat changes variable order 420930870 | |
473684645 | https://github.com/pydata/xarray/issues/2811#issuecomment-473684645 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3MzY4NDY0NQ== | kmuehlbauer 5821660 | 2019-03-17T17:01:39Z | 2019-03-17T17:16:14Z | MEMBER | @shoyer I think I found the relevant lines of code in In the docs there is a Warning: We are changing the behavior of iterating over a Dataset the next major release of xarray, to only include data variables instead of both data variables and coordinates. In the meantime, prefer iterating over ds.data_vars or ds.coords. below here. Does that mean that this also affects internal machinery (like in concat)? If so, could you point me to some code where this is taken care of or give some explanation or links where this is discussed? Update: I' working with latest 0.12.0 release. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
concat changes variable order 420930870 | |
473416359 | https://github.com/pydata/xarray/issues/2811#issuecomment-473416359 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3MzQxNjM1OQ== | kmuehlbauer 5821660 | 2019-03-15T19:37:55Z | 2019-03-15T19:38:52Z | MEMBER | Just as note for me, to not have to reiterate:
Example (dst concat over 'x'):
The ordering of the src_dim1 is because the dimensions in the variables/coordinates are x,y,z in that order. The ordering of the dst_dim1 is because the dimensions in the variables/coordinates are z, y, x.
It seems, that the two coordinates (z and y) are written first, then the variables, and then the changed coordinate. Now trying to find, where this happens. If the two coordinates would be written in the same way as the variables (and after them), then the ordering would be x,y,z as in the source. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
concat changes variable order 420930870 | |
473372508 | https://github.com/pydata/xarray/issues/2811#issuecomment-473372508 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3MzM3MjUwOA== | kmuehlbauer 5821660 | 2019-03-15T17:19:59Z | 2019-03-15T17:33:10Z | MEMBER | @shoyer I'm working on a notebook with all testing inside. Just found that if I have 3 dimensions ('c', 'd', 'b') the ordering is preserved in ~any case~ (~with and~ without coords) for concat along any dimension. Will link the notebook next day. Update: Need to be more thorough...with coordinates it reorders also with 3 dims. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
concat changes variable order 420930870 | |
473365110 | https://github.com/pydata/xarray/issues/2811#issuecomment-473365110 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3MzM2NTExMA== | kmuehlbauer 5821660 | 2019-03-15T16:59:58Z | 2019-03-15T16:59:58Z | MEMBER | Sorry, fat fingers... |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
concat changes variable order 420930870 | |
473364973 | https://github.com/pydata/xarray/issues/2811#issuecomment-473364973 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3MzM2NDk3Mw== | kmuehlbauer 5821660 | 2019-03-15T16:59:38Z | 2019-03-15T16:59:38Z | MEMBER | @shoyer Yes, that was what I was assuming. But was a bit confused too, as the concat docs say, that dimension order is not affected. But maybe I get this wrong and the order of dimensions is not affected only for DataArrays. IIUC xarray creates a new dataset during concat, because the dimensions cannot be expanded (due to netCDF4 limitations). So I would need to look at that specific part, where this creation process takes place. I would also not speak of "bug" here, but if such reordering happens only in certain conditions users (I mean at least me) can get confused. I'll try to find out under what conditions this happens and try to come up with some workaround. Will also try ti find my way through the concat-mechanism. Again, I really appreciate your help in this issue. I can rename the issue to a somewhat better name, do you have a suggestion? Ambiguous dimension reorder in Dataset concat maybe? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
concat changes variable order 420930870 | |
473354516 | https://github.com/pydata/xarray/issues/2811#issuecomment-473354516 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3MzM1NDUxNg== | kmuehlbauer 5821660 | 2019-03-15T16:30:38Z | 2019-03-15T16:30:38Z | MEMBER | @shoyer I'm sorry if I did not explain well enough and if my intentions were vague. So let me first clarify, I really appreciate all your hard work to make xarray better. I've adapted many of my workflows to use xarray and I'm happy that such a library exist. Let's consider just one more example where I hopefully get better to the point of my problems in understanding. Two files are created, same dimensions, same data, but one without coordinates the other with coordinates. ```python data = np.zeros((2,3)) src_dim0 = xr.Dataset({'test': (['c', 'b'], data)}) src_dim0.to_netcdf('src_dim0.nc') src_dim1 = xr.Dataset({'test': (['c', 'b'], data)},
coords={'c': (['c'], np.arange(data.shape[0])),
'b': (['b'], np.arange(data.shape[1])),})
src_dim1.to_netcdf('src_dim1.nc')
test = 0, 0, 0, 0, 0, 0 ; } netcdf src_dim1 { dimensions: c = 2 ; b = 3 ; variables: double test(c, b) ; test:_FillValue = NaN ; int64 c(c) ; int64 b(b) ; data: test = 0, 0, 0, 0, 0, 0 ; c = 0, 1 ; b = 0, 1, 2 ; } ``` Now, from the dump, the 'c' dimension is first in both. Lets read those files again and concat them along the ```python dst_dim0 = xr.open_dataset('src_dim0.nc') dst_dim0 = xr.concat([dst_dim0, dst_dim0], dim='c') dst_dim0.to_netcdf('dst_dim0.nc') dst_dim1 = xr.open_dataset('src_dim1.nc') dst_dim1 = xr.concat([dst_dim1, dst_dim1], dim='c') dst_dim1.to_netcdf('dst_dim1.nc') ``` Now, and this is what confuses me, the file without coordinates has 'c' dimension first and the file with coordinates has 'b' dimension first.: ``` netcdf dst_dim0 { dimensions: c = 4 ; b = 3 ; variables: double test(c, b) ; test:_FillValue = NaN ; data: test = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; } netcdf dst_dim1 { dimensions: b = 3 ; c = 4 ; variables: int64 b(b) ; double test(c, b) ; test:_FillValue = NaN ; int64 c(c) ; data: b = 0, 1, 2 ; test = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; c = 0, 1, 0, 1 ; } ``` I really like to understand why there is this difference. Thanks for your patience! |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
concat changes variable order 420930870 | |
473327326 | https://github.com/pydata/xarray/issues/2811#issuecomment-473327326 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3MzMyNzMyNg== | kmuehlbauer 5821660 | 2019-03-15T15:19:54Z | 2019-03-15T15:20:42Z | MEMBER |
I was assuming something along that lines. But in my variable My use case is, that the dimensions should appear in the same order as in the source files. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
concat changes variable order 420930870 | |
473187958 | https://github.com/pydata/xarray/issues/2811#issuecomment-473187958 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3MzE4Nzk1OA== | kmuehlbauer 5821660 | 2019-03-15T07:39:09Z | 2019-03-15T07:39:09Z | MEMBER | Thanks for looking into this @shoyer.
This isn't true for my system. If we consider this example:
``` netcdf test_dims { dimensions: c = 2 ; b = 3 ; variables: double test(c, b) ; test:_FillValue = NaN ; int64 c(c) ; int64 b(b) ; data: test = 0, 0, 0, 0, 0, 0 ; c = 0, 1 ; b = 0, 1, 2 ;
}
b = 0, 1, 2 ; test = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; c = 0, 1, 0, 1 ; } ``` My use case is, well, I have to use some legacy code. Concerning my code, yes I'm trying to write it as robust as possible. Finally I wan't to replace the legacy code with the implementation relying completely on xarray, but that's a long way to go. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
concat changes variable order 420930870 | |
473178870 | https://github.com/pydata/xarray/issues/2811#issuecomment-473178870 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3MzE3ODg3MA== | kmuehlbauer 5821660 | 2019-03-15T06:55:28Z | 2019-03-15T06:55:43Z | MEMBER | This has also implications for the output using Now, as the I did not find any hints in the docs on that topic. I need to preserve the original dimension ordering as declared in the source dataset. How can I achieve this using xarray? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
concat changes variable order 420930870 | |
472787019 | https://github.com/pydata/xarray/issues/2811#issuecomment-472787019 | https://api.github.com/repos/pydata/xarray/issues/2811 | MDEyOklzc3VlQ29tbWVudDQ3Mjc4NzAxOQ== | kmuehlbauer 5821660 | 2019-03-14T10:13:48Z | 2019-03-14T10:13:48Z | MEMBER | Xref: Gitter Chat |
{ "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
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]);
user 1