issue_comments: 444708274
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/pull/2553#issuecomment-444708274 | https://api.github.com/repos/pydata/xarray/issues/2553 | 444708274 | MDEyOklzc3VlQ29tbWVudDQ0NDcwODI3NA== | 35968931 | 2018-12-06T00:56:01Z | 2018-12-06T01:01:49Z | MEMBER | Thanks for the comments.
This is supported. This new ```python objs = [[Dataset({'foo': ('x', [0, 1])}), Dataset({'bar': ('x', [10, 20])})], [Dataset({'foo': ('x', [2, 3])}), Dataset({'bar': ('x', [30, 40])})]] expected = Dataset({'foo': ('x', [0, 1, 2, 3]), 'bar': ('x', [10, 20, 30, 40])}) This worksactual = auto_combine(objs, concat_dims=['x', None]) assert_identical(expected, actual) Also works auto-magicallyactual = auto_combine(objs) assert_identical(expected, actual) Proving it works symmetricallyobjs = [[Dataset({'foo': ('x', [0, 1])}), Dataset({'foo': ('x', [2, 3])})], [Dataset({'bar': ('x', [10, 20])}), Dataset({'bar': ('x', [30, 40])})]] actual = auto_combine(objs, concat_dims=[None, 'x']) assert_identical(expected, actual) ``` (I'll add this example as another unit test) I should point out that there is one way in which this function is not exactly as general as
That was basically what I tried to do in my first attempt, but nested concatenation without merging along every dimension misses some common use cases, for example if you wanted to You might also find it interesting to see how I've used this fork in my own code: I create the grid of datasets here, so that I can combine them here. I have a question actually - currently if the concat or merge fails, then the error message won't clearly tell you which dimension it was trying to combine along when it failed. Is there a way to do that easily with (Also something else is breaking in |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
379415229 |