-
-
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
Documentation of DataArray does not warn that inferring dimension names is deprecated #3820
Comments
Agree! Thanks for spotting @sjvrijn . PR is appreciated, thanks for the offer! |
For the PR: in general we don't need to document deprecated behavior, so you can remove than description rather than caveat it |
@max-sixty Thanks for the tip. In the end it meant just changing the last line on On a related note: according to #727 (PR #993), this was deprecated since key-order in dictionaries was arbitrary at the time of that issue. However, their order is fixed since Python3.7, as noted in the documentation:
I guess it's still too soon to 'un-deprecate' this behavior again? 👼 |
Ha! We do support 3.6. I think that almost everyone is using xarray with CPython, so it's almost certainly safe. But maybe not worth the tradeoff given the benefit is marginal, what are your thoughts? |
I think that inferring dimension-names from the Passing a dictionary for An example of how I create them from my current project:
If you expect almost everyone to use CPython or 3.7+ anyway, then I don't actually see any drawbacks, while it would regularly make code shorter and less repetitive. |
I definitely agree it's better if possible. I think the tradeoff is between better for almost everyone vs the potential of a break for a small minority. Currently we support python versions for 42 months, and Python 3.6 was released December 2016. So that means we support it until July 2020 -- given that timeframe I think we wait until then and add this back? |
Waiting a few more months until it will definitely not be a problem for anyone seems fair to me 👍 |
Note that inferring dimensions from coords when it is a list of tuples does still work (with no deprecation warning):
|
pydata#3821) * removed mention that 'dims' are inferred from 'coords'-dict when omitted in DataArray (fixes pydata#3820) * added summary of PR pydata#3821 to whats-new
The documentation states:
Which seems to be no longer the case.
MCVE Code Sample
Expected Output
An update of the documentation to correctly specify the current behavior. (I'll propose a PR later today)
Problem Description
A mismatch between API specification and it's behavior seems like a problem to me :)
Output of
xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.8.1 (default, Feb 11 2020, 12:54:25)
[GCC 5.4.0 20160609]
python-bits: 64
OS: Linux
OS-release: 4.15.0-88-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_IE.UTF-8
LOCALE: en_IE.UTF-8
libhdf5: 1.10.4
libnetcdf: 4.6.3
xarray: 0.14.1
pandas: 0.25.3
numpy: 1.18.0
scipy: 1.4.1
netCDF4: 1.5.3
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.0.4.2
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: 3.1.2
cartopy: None
seaborn: None
numbagg: None
setuptools: 45.2.0
pip: 20.0.2
conda: None
pytest: None
IPython: 7.11.1
sphinx: 2.3.1
The text was updated successfully, but these errors were encountered: