issues: 503562032
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
503562032 | MDU6SXNzdWU1MDM1NjIwMzI= | 3377 | Changed behavior for replacing coordinates on dataset. | 14314623 | closed | 0 | 5 | 2019-10-07T16:32:33Z | 2019-10-11T15:47:57Z | 2019-10-11T15:47:57Z | CONTRIBUTOR | MCVE Code SampleWe noticed a change in behavior in xarray that broke a test in xgcm. Consider this code example: ```python import xarray as xr import numpy as np x = np.arange(5) data = xr.DataArray(np.random.rand(5), coords={'x':x }, dims=['x']) x_c = np.arange(5) + 0.5 data_c = xr.DataArray(np.random.rand(5), coords={'x_c':x_c }, dims=['x_c']) ds = xr.Dataset({'data':data, 'data_c':data_c}) del ds['data_c'] ds['x_c'] = ds['x_c'][:3] ds ``` Expected OutputIn previous versions of xarray this resulted in
In the current master branch instead the coordinate gets padded with nans:
Problem DescriptionWe fixed the test in a new PR, but @dcherian encouraged me to submit this. Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3377/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |