issue_comments
13 rows where issue = 566490806 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: reactions, created_at (date), updated_at (date)
issue 1
- Allow xr.combine_by_coords to work with point coordinates? · 13 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
866963499 | https://github.com/pydata/xarray/issues/3774#issuecomment-866963499 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDg2Njk2MzQ5OQ== | TomNicholas 35968931 | 2021-06-23T15:58:10Z | 2021-06-23T15:58:10Z | MEMBER | Looking back at @shoyer 's comments above I think I'm just going to close this (and the corresponding PR #3982) for now. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
617352770 | https://github.com/pydata/xarray/issues/3774#issuecomment-617352770 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDYxNzM1Mjc3MA== | TomNicholas 35968931 | 2020-04-21T18:59:53Z | 2020-04-21T18:59:53Z | MEMBER |
Fair enough. Those are good reasons.
The fact that you can solve this use case with
The error you get is
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
617280517 | https://github.com/pydata/xarray/issues/3774#issuecomment-617280517 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDYxNzI4MDUxNw== | shoyer 1217238 | 2020-04-21T16:49:55Z | 2020-04-21T16:49:55Z | MEMBER | I don't think it's a great idea to automatically turn scalar coords into 1d arrays. It's not uncommon to have datasets with a whole handful of scalar coordinates, which could potentially become very high dimensional due to this change. I also don't like fallback logic that tries to do matching by coordinates with dimensions first, and then falls back to using scalars. These types of heuristics look very convenient first (and are very convenient much of the time) but then have a tendency to fail in unexpected/unpredictable ways. The other choice for situations like this would be to encourage switching to
We could even put a reference to |
{ "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
616633079 | https://github.com/pydata/xarray/issues/3774#issuecomment-616633079 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDYxNjYzMzA3OQ== | TomNicholas 35968931 | 2020-04-20T15:37:10Z | 2020-04-20T15:37:10Z | MEMBER |
@shoyer it would expand and stack along both, filling the (many) gaps created with ```python import xarray as xr data_0 = xr.Dataset({'temperature': ('time', [10,20,30])}, coords={'time': [0,1,2]}) data_0.coords['trial'] = 0 # scalar coords data_0.coords['day'] = 1 data_1 = xr.Dataset({'temperature': ('time', [50,60,70])}, coords={'time': [0,1,2]}) data_1.coords['trial'] = 1 data_1.coords['day'] = 0 both scalar coords will be promoted to dimsall_trials = xr.combine_by_coords([data_0, data_1])
print(all_trials)
[[10. 20. 30.] [nan nan nan]]] ``` This gap-filling isn't new though - without this PR the same thing already happens with length-1 dimension coords (since PR #3649 - see my comment there) ```python data_0 = xr.Dataset({'temperature': ('time', [10,20,30])}, coords={'time': [0,1,2]}) data_0.coords['trial'] = [0] # 1D dimension coords data_0.coords['day'] = [1] data_1 = xr.Dataset({'temperature': ('time', [50,60,70])}, coords={'time': [0,1,2]}) data_1.coords['trial'] = [1] data_1.coords['day'] = [0] all_trials = xr.combine_by_coords([data_0, data_1])
print(all_trials)
```python gaps will again be filled in with NaNsprint(all_trials['temperature'].data)
[[50. 60. 70.] [nan nan nan]]] ``` So all my PR is doing is promoting all scalar coordinates (those which aren't equal across all datasets) to dimension coordinates before combining. There is a chance this could unwittingly increase the overall size of people's datasets (when they have different scalar coordinates in different datasets), but that could already happen since #3649. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
616074546 | https://github.com/pydata/xarray/issues/3774#issuecomment-616074546 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDYxNjA3NDU0Ng== | shoyer 1217238 | 2020-04-19T08:22:50Z | 2020-04-19T08:22:50Z | MEMBER | Suppose there were multiple scalar coordinates that are unique for each variable. How would |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
615985368 | https://github.com/pydata/xarray/issues/3774#issuecomment-615985368 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDYxNTk4NTM2OA== | TomNicholas 35968931 | 2020-04-19T00:02:18Z | 2020-04-19T00:02:18Z | MEMBER | I opened a PR to fix this. Also I realised that what I said about dealing with ambiguities of multiple coordinates for the same dimension doesn't make sense. In that situation there is no way to know the user wanted each of the (I did make sure it handles the case which caused |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
615978015 | https://github.com/pydata/xarray/issues/3774#issuecomment-615978015 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDYxNTk3ODAxNQ== | dcherian 2448579 | 2020-04-18T23:27:04Z | 2020-04-18T23:27:04Z | MEMBER | Ok sounds good. Thanks |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
615953378 | https://github.com/pydata/xarray/issues/3774#issuecomment-615953378 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDYxNTk1MzM3OA== | TomNicholas 35968931 | 2020-04-18T21:33:40Z | 2020-04-18T21:33:40Z | MEMBER | @dcherian it looks like the old ```python import xarray as xr from xarray.core.combine import _old_auto_combine data_0 = xr.Dataset({'temperature': ('time', [10,20,30])}, coords={'time': [0,1,2]}) data_0.coords['trial'] = 0 data_1 = xr.Dataset({'temperature': ('time', [50,60,70])}, coords={'time': [0,1,2]}) data_1.coords['trial'] = 1 all_trials = _old_auto_combine([data_0, data_1], concat_dim='trial')
print(all_trials)
So technically this issue doesn't need to be closed before completely removing the old |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
615466897 | https://github.com/pydata/xarray/issues/3774#issuecomment-615466897 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDYxNTQ2Njg5Nw== | dcherian 2448579 | 2020-04-17T21:15:34Z | 2020-04-17T21:15:34Z | MEMBER | @TomNicholas I think this is the case I ran into. Does the old |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
590925016 | https://github.com/pydata/xarray/issues/3774#issuecomment-590925016 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDU5MDkyNTAxNg== | TomNicholas 35968931 | 2020-02-25T15:30:20Z | 2020-02-25T15:30:20Z | MEMBER |
By the way, there is an additional problem to consider in addition to the above: ambiguity with multiple coordinates for the same dimension. ```python data0 = xr.Dataset({'temperature': ('time', [10,20,30])}, coords={'time': [0,1,2]}) data0.coords['trial'] = 0 data0.coords['day'] = 5 data1 = xr.Dataset({'temperature': ('time', [50,60,70])}, coords={'time': [0,1,2]}) data1.coords['trial'] = 1 data1.coord['day'] = 3 ``` In this example then We could pass extra optional arguments to deal with this, but for a "magic" function that doesn't seem desirable. It might be better to have some logic like: 1) Is there a dimension coordinate for this dimension? If yes just use that. 2) Otherwise, can the datasets be unambiguously ordered along the dim by looking at non-dimension coords? 3) If yes, do that, if no, throw informative error. That would be backwards-compatible (currently all magic ordering is being done for dimension coords), and not make any arbitrary choices. |
{ "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
590917430 | https://github.com/pydata/xarray/issues/3774#issuecomment-590917430 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDU5MDkxNzQzMA== | kazimuth 555667 | 2020-02-25T15:16:00Z | 2020-02-25T15:16:00Z | NONE | is |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
588178645 | https://github.com/pydata/xarray/issues/3774#issuecomment-588178645 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDU4ODE3ODY0NQ== | TomNicholas 35968931 | 2020-02-19T11:37:58Z | 2020-02-19T11:40:25Z | MEMBER | I did get one test failure ``` def test_preprocess_mfdataset(self): original = Dataset({"foo": ("x", np.random.randn(10))}) with create_tmp_file() as tmp: original.to_netcdf(tmp)
xarray/tests/test_backends.py:2955: AssertionError ``` I think the problem here is that it's happily promoting the coord to a coordinate dimension even though there is only 1 dataset. We should probably only expand dims which are going to be used in the concatenation... |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 | |
588165645 | https://github.com/pydata/xarray/issues/3774#issuecomment-588165645 | https://api.github.com/repos/pydata/xarray/issues/3774 | MDEyOklzc3VlQ29tbWVudDU4ODE2NTY0NQ== | TomNicholas 35968931 | 2020-02-19T11:07:26Z | 2020-02-19T11:34:41Z | MEMBER | Hi @kazimuth , thanks for highlighting this! This is a case which I can see the argument for handling, but we apparently didn't think of when implementing What this really boils down to is "should
This function is supposed to be "magic". But the behaviour still needs to be clearly-defined.
Yes - I actually got your example to work with just a few extra lines. Change the top of ```python def _infer_concat_order_from_coords(datasets):
```
I don't think it would be breaking... the only cases which would behave differently are ones which would previously would have thrown an error. Would have to think about this though. Might you be interested in submitting a PR along these lines @kazimuth ? It would require some more robust input checks, some tests for different cases, and some minor changes to docstrings I think. |
{ "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
Allow xr.combine_by_coords to work with point coordinates? 566490806 |
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 4