home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

11 rows where issue = 484270833 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 6

  • aijams 3
  • TomNicholas 3
  • dcherian 2
  • shoyer 1
  • max-sixty 1
  • friedrichknuth 1

author_association 3

  • MEMBER 7
  • CONTRIBUTOR 3
  • NONE 1

issue 1

  • combine_by_coords fails with DataArrays · 11 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions performed_via_github_app issue
777037245 https://github.com/pydata/xarray/issues/3248#issuecomment-777037245 https://api.github.com/repos/pydata/xarray/issues/3248 MDEyOklzc3VlQ29tbWVudDc3NzAzNzI0NQ== aijams 22328646 2021-02-10T21:08:06Z 2021-02-10T21:08:06Z CONTRIBUTOR

It looks like this issue has been neglected for a while. @TomNicholas, can you take a look at this PR?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords fails with DataArrays 484270833
741908629 https://github.com/pydata/xarray/issues/3248#issuecomment-741908629 https://api.github.com/repos/pydata/xarray/issues/3248 MDEyOklzc3VlQ29tbWVudDc0MTkwODYyOQ== TomNicholas 35968931 2020-12-09T17:03:24Z 2020-12-09T17:03:24Z MEMBER

@aijams while that isn't quite how I think about it, I think that is an accurate description of what combine_by_coords does :blush:

I'm assuming the main issue here is to have combine_by_coords put a set of unnamed DataArrays into a single group and paste them together.

Yes - which involves making the assumption that these different unnamed DataArrays are actually the same physical variable, and so can be meaningfully combined into a group.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords fails with DataArrays 484270833
739060150 https://github.com/pydata/xarray/issues/3248#issuecomment-739060150 https://api.github.com/repos/pydata/xarray/issues/3248 MDEyOklzc3VlQ29tbWVudDczOTA2MDE1MA== aijams 22328646 2020-12-04T22:36:45Z 2020-12-08T12:09:55Z CONTRIBUTOR

My comprehension of the combine_by_coords function is as follows: Given a set of DataArrays (possibly obtained by splitting apart data sets), group them by name and paste the arrays from each group onto an array of nans with the same dimension set as each member of that group. The result for each group will be a DataArray with an entry for each element of the Cartesian product of that group's coordinates.

I'm assuming the main issue here is to have combine_by_coords put a set of unnamed DataArrays into a single group and paste them together.

@TomNicholas, does this seem accurate to you?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords fails with DataArrays 484270833
737591086 https://github.com/pydata/xarray/issues/3248#issuecomment-737591086 https://api.github.com/repos/pydata/xarray/issues/3248 MDEyOklzc3VlQ29tbWVudDczNzU5MTA4Ng== TomNicholas 35968931 2020-12-03T01:02:46Z 2020-12-03T01:02:46Z MEMBER

Hi @max-sixty good question, and it would be nice to fix this!

I think that if we go with the scheme suggested by @dcherian for handling this issue then it answers the question I posed in #3312 - the answer being that we care more about combine_by_coords happily accepting two unnamed DataArrays than we do about it being consistent with merge by throwing an error. If we're happy with that then I think it shouldn't be too difficult to finish off the PR in #3312?

(I think that this bug mentioned in #3312 is separate, and possibly deserves its own small issue.)

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords fails with DataArrays 484270833
736022156 https://github.com/pydata/xarray/issues/3248#issuecomment-736022156 https://api.github.com/repos/pydata/xarray/issues/3248 MDEyOklzc3VlQ29tbWVudDczNjAyMjE1Ng== max-sixty 5635139 2020-11-30T20:24:46Z 2020-11-30T20:24:46Z MEMBER

Hi @aijams — this issue is still current! There are some notes from @TomNicholas on this PR: https://github.com/pydata/xarray/pull/3312. Though it looks like there may be an outstanding question on @shoyer there.

@TomNicholas any thoughts on whether this is ready for a contribution?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords fails with DataArrays 484270833
735852114 https://github.com/pydata/xarray/issues/3248#issuecomment-735852114 https://api.github.com/repos/pydata/xarray/issues/3248 MDEyOklzc3VlQ29tbWVudDczNTg1MjExNA== aijams 22328646 2020-11-30T15:22:24Z 2020-11-30T15:22:24Z CONTRIBUTOR

Hello, I'm new to open source development and xarray. I would like to help with this issue, however it appears that nothing has been done for over a year. Is this issue stale or does it still need to be addressed?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords fails with DataArrays 484270833
531825386 https://github.com/pydata/xarray/issues/3248#issuecomment-531825386 https://api.github.com/repos/pydata/xarray/issues/3248 MDEyOklzc3VlQ29tbWVudDUzMTgyNTM4Ng== dcherian 2448579 2019-09-16T15:19:50Z 2019-09-16T15:20:59Z MEMBER

Thanks @friedrichknuth .

It looks like all the combine functions expect lists of Datasets, not DataArrays (see docstrings).

It should be relatively easily to make this work like merge which can take a list of Datasets or DataArrays. See this code in merge: https://github.com/pydata/xarray/blob/756c94164840e8c070bcd26681b97c31412909ae/xarray/core/merge.py#L593-L602

to_dataset will fail for unnamed DataArrays, but _to_temp_dataset() will succeed. It seems to me like we want lists of unnamed DataArrays to work (like in the first example), so call _to_temp_dataset when needed. Maybe @shoyer has an idea on how to implement that cleanly.

Can you send in a PR?

{
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords fails with DataArrays 484270833
531511177 https://github.com/pydata/xarray/issues/3248#issuecomment-531511177 https://api.github.com/repos/pydata/xarray/issues/3248 MDEyOklzc3VlQ29tbWVudDUzMTUxMTE3Nw== friedrichknuth 10554254 2019-09-14T20:31:22Z 2019-09-14T20:31:22Z NONE

Some additional information on the topic:

Combining named 1D data arrays works. ``` da1 = xr.DataArray(name='foo', data=np.random.randn(3), coords=[('x', [1, 2, 3])]) da2 = xr.DataArray(name='foo', data=np.random.randn(3), coords=[('x', [5, 6, 7])]) xr.combine_by_coords([da1, da2])

<xarray.Dataset> Dimensions: (x: 6) Coordinates: * x (x) int64 1 2 3 5 6 7 Data variables: foo (x) float64 1.443 0.4889 0.9233 0.1946 -1.639 -1.455 ```

However, when combining 2D gridded data...

``` da1 = xr.DataArray(name='foo', data=np.random.rand(3,3), coords=[('x', [1, 2, 3]), ('y', [1, 2, 3])])

da2 = xr.DataArray(name='foo', data=np.random.rand(3,3), coords=[('x', [5, 6, 7]), ('y', [5, 6, 7])])

xr.combine_by_coords([da1, da2]) ...the method fails, despite passing a data variable name.


ValueError Traceback (most recent call last) <ipython-input-145-77ae89136c1f> in <module> 9 ('y', [5, 6, 7])]) 10 ---> 11 xr.combine_by_coords([da1, da2])

~/xarray/xarray/core/combine.py in combine_by_coords(datasets, compat, data_vars, coords, fill_value, join) 580 581 # Group by data vars --> 582 sorted_datasets = sorted(datasets, key=vars_as_keys) 583 grouped_by_vars = itertools.groupby(sorted_datasets, key=vars_as_keys) 584

~/xarray/xarray/core/combine.py in vars_as_keys(ds) 465 466 def vars_as_keys(ds): --> 467 return tuple(sorted(ds)) 468 469

~/xarray/xarray/core/common.py in bool(self) 119 120 def bool(self: Any) -> bool: --> 121 return bool(self.values) 122 123 def float(self: Any) -> float:

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all() ``` Again, converting to a dataset bypasses the issue.

``` ds1 = da1.to_dataset() ds2 = da2.to_dataset() xr.combine_by_coords([ds1, ds2])

<xarray.Dataset> Dimensions: (x: 6, y: 6) Coordinates: * x (x) int64 1 2 3 5 6 7 * y (y) int64 1 2 3 5 6 7 Data variables: foo (x, y) float64 0.5078 0.8981 0.8707 nan ... 0.4172 0.7259 0.8431 ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords fails with DataArrays 484270833
526263925 https://github.com/pydata/xarray/issues/3248#issuecomment-526263925 https://api.github.com/repos/pydata/xarray/issues/3248 MDEyOklzc3VlQ29tbWVudDUyNjI2MzkyNQ== dcherian 2448579 2019-08-29T16:31:41Z 2019-08-29T16:31:41Z MEMBER

What do you think of:

  1. If combine receives a list of unnamed DataArrays, we convert them to temp datasets and then pass datasets down to merge.

  2. If combine receives a list of named DataArrays, then merge will do the right thing.

  3. If combine receives a list containing both Datasets and unnamed DataArrays then merge will raise the right error.

So really it's just (1) that needs a special case in the combine functions?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords fails with DataArrays 484270833
526251545 https://github.com/pydata/xarray/issues/3248#issuecomment-526251545 https://api.github.com/repos/pydata/xarray/issues/3248 MDEyOklzc3VlQ29tbWVudDUyNjI1MTU0NQ== TomNicholas 35968931 2019-08-29T15:59:24Z 2019-08-29T15:59:24Z MEMBER

@dcherian is this a merge problem, or a combine_by_coords problem?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords fails with DataArrays 484270833
524517012 https://github.com/pydata/xarray/issues/3248#issuecomment-524517012 https://api.github.com/repos/pydata/xarray/issues/3248 MDEyOklzc3VlQ29tbWVudDUyNDUxNzAxMg== shoyer 1217238 2019-08-24T04:00:41Z 2019-08-24T04:00:41Z MEMBER

+1 we should make this work!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  combine_by_coords fails with DataArrays 484270833

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