issues: 46022646
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
46022646 | MDU6SXNzdWU0NjAyMjY0Ng== | 254 | order matters when doing comparisons against scalar xray objects | 291576 | closed | 0 | 799012 | 2 | 2014-10-16T19:03:11Z | 2014-10-23T06:43:30Z | 2014-10-23T06:43:23Z | CONTRIBUTOR | Working on some bounding box extraction code, I computed a bounding box by taking mins and maxes of the coordinates from an xray object resulting in a dictionary of scalar xray objects. When comparing an xray DataArray against this scalar xray object, the order seems to matter. This results in problems down the road that wouldn't happen if I just had a scalar value instead of a scalar xray object. ```
See that the "a" object has a name "longitude" while the "b" object does not. Therefore... ```
But, if I use the "c" object instead which was created flipping the comparison around: ```
everything works as expected. I have a vague idea of why this is happening, but I am not exactly sure how one should go about dealing with this. It is a similar problem elsewhere with subclassed numpy arrays. For now, I am going to have to go with the rule of keeping the xray dataarray object first, but that really isn't going to work in other places where I may not know that I am passing xray objects. |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/254/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |