home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 535010456

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/issues/3315#issuecomment-535010456 https://api.github.com/repos/pydata/xarray/issues/3315 535010456 MDEyOklzc3VlQ29tbWVudDUzNTAxMDQ1Ng== 35968931 2019-09-25T13:00:13Z 2019-09-25T13:00:13Z MEMBER

Okay something has definitely gone wrong here.

My intention with that test was to check that the order of operations doesn't matter, but you're right that the test as written makes no sense. It would probably be a good idea to remove this test and check that property correctly by adding a second assert to the (poorly-named) test_auto_combine_2d: ```python

Prove it works symmetrically

datasets = [[ds(0), ds(3)], [ds(1), ds(4)], [ds(2), ds(5)]] result = combine_nested(datasets, concat_dim=["dim2", "dim1"]) assert_equal(result, expected) ``` (This passes fine)

However, that still leaves the question of why is this nonsensical test passing?

I think it's because concat is not failing when it should - that test boils down to calling concat on those DataArrays (called from _combine_1d internally). Surely concat should fail when you ask it to do this, because how can you concatenate two different variables? ```python da1 = DataArray(name="a", data=[[0]], dims=["x", "y"]) da2 = DataArray(name="b", data=[[1]], dims=["x", "y"])

result = concat([da1, da2], dim="x") However it doesn't fail, instead it gives this!: <xarray.DataArray 'a' (x: 2, y: 1)> array([[0], [1]]) Dimensions without coordinates: x, y `` Where has'b'gone?! This is the reason thattest_concat_name_symmetry` gives such a weird result.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  494906646
Powered by Datasette · Queries took 0.728ms · About: xarray-datasette