issues: 128718628
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
128718628 | MDU6SXNzdWUxMjg3MTg2Mjg= | 724 | Behavior of ds.rename when old and new name are the same | 6200806 | closed | 0 | 2 | 2016-01-26T04:12:24Z | 2016-02-02T01:33:03Z | 2016-02-02T01:33:03Z | CONTRIBUTOR | Before #648, passing ``` python arr = xr.DataArray(range(2), name='arrname') ds = arr.to_dataset() ds.rename({'dim_0':'dim_0'}) ValueError Traceback (most recent call last) <ipython-input-15-a5b851f9fb10> in <module>() ----> 1 ds.rename({'dim_0':'dim_0'}) /Users/spencerahill/anaconda/lib/python2.7/site-packages/xarray/core/dataset.pyc in rename(self, name_dict, inplace) 1245 "variable in this dataset" % k) 1246 if v in self: -> 1247 raise ValueError('the new name %r already exists' % v) 1248 1249 variables = OrderedDict() ValueError: the new name 'dim_0' already exists ``` This is easy enough to handle with a try/except clause in my own code, but it would be nice (for me at least) for The use case is that we have data coming from multiple sources, often with differing internal names for coordinates and variables, and we're programmatically forcing them to have consistent names via |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/724/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |