-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed behavior for replacing coordinates on dataset. #3377
Comments
Thanks for submitting. Confirmed. I couldn't work out the cause quickly, can have another look later; unless anyone knows immediately. |
I looked into this a bit tonight. I think this may be related to @shoyer's recent explicit indexes refactor (#3234). I'm having trouble following some of the new logic but it seems we're not updating the size of the |
Yes, it was definitely my explicit indexes refactor. Apparently this wasn't tested? Here's a simpler reproduction: import xarray as xr
ds = xr.Dataset({"x": [0, 1, 2]})
ds["x"] = ds["x"][:2]
assert ds.sizes["x"] == 2, ds |
MCVE Code Sample
We noticed a change in behavior in xarray that broke a test in xgcm.
Consider this code example:
Expected Output
In previous versions of xarray this resulted in
(I tested right now with an older
v0.11.3
but this works withv0.13
as well.In the current master branch instead the coordinate gets padded with nans:
Problem Description
We fixed the test in a new PR, but @dcherian encouraged me to submit this.
Output of
xr.show_versions()
xarray: 0.13.0+24.g4254b4af
pandas: 0.25.1
numpy: 1.17.2
scipy: None
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: 2.5.0
distributed: 2.5.1
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
setuptools: 41.2.0
pip: 19.2.3
conda: None
pytest: 5.2.0
IPython: 7.8.0
sphinx: None
The text was updated successfully, but these errors were encountered: