pydata / pydata/xarray

[Bug]: coords: a list or dictionary of coordinates. , but dictionary is outdated

Open
#6,202 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

What happened?

Under "Creating a Data Array" and next to the subitem "coords", it is written, that you can use a dictionary like {'coo1': [1,2,3], 'coo2': ['a', 'b', 'c'], ...}, so you can later skip the "dims". But when I tried this, I get the message, that using a dictionary for coords is outdated.

'ValueError: inferring DataArray dimensions from dictionary like coords is no longer supported. Use an explicit list of dims instead.'

It still works with a list of tuples like: [ ('coo1', [1,2,3]), ('coo2', ['a', 'b', 'c'] ), ... ]

What did you expect to happen?

No response

Minimal Complete Verifiable Example

No response

Relevant log output

No response

Anything else we need to know?

No response

Environment

INSTALLED VERSIONS

commit: None
python: 3.6.9 (default, Dec 8 2021, 21:08:43)
[GCC 8.4.0]
python-bits: 64
OS: Linux
OS-release: 4.15.0-163-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
libhdf5: 1.10.0
libnetcdf: 4.6.0

xarray: 0.16.2
pandas: 1.1.5
numpy: 1.19.5
scipy: 0.19.1
netCDF4: 1.3.1
pydap: None
h5netcdf: 0.5.0
h5py: 2.7.1
Nio: None
zarr: None
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: 1.2.0
dask: 0.16.0
distributed: 0+unknown
matplotlib: 3.3.4
cartopy: 0.14.2
seaborn: None
numbagg: None
pint: 0.8.1
setuptools: 39.0.1
pip: 21.3.1
conda: None
pytest: None
IPython: 5.5.0
sphinx: 1.6.7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

In the “Creating a Data Array” documentation, inspect the coords description and its dictionary example. Update the text to match the reported ValueError and the still-supported list-of-tuples form, then verify the revised documentation renders correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.