-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix typing for coords argument in DataArray #5671
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
Comments
Good spot, thanks @DeltaSigma130 . I think this should be a fairly easy fix if anyone is up for taking this. I'm somewhat surprised that it's not covered in our existing code such that mypy fails within xarray. |
I can confirm this issue when specifying dimensions with coordinates, as per this example:
MyPy output:
I can work around it by specifying the type of
There is some discussion about |
Problem
Mypy reports errors on anything other than a list of tuples passed to
coords
inxr.DataArray
constructor even thoughxr.Variable
andxr.DataArray
are valid objects.Code
Contained in file
type_test.py
.Running Python
Running MyPy
Environment
Output of xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.9.1 (default, Dec 11 2020, 09:29:25) [MSC v.1916 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: English_United States.1252
libhdf5: 1.10.6
libnetcdf: 4.6.1
xarray: 0.18.0
pandas: 1.2.1
numpy: 1.20.2
scipy: 1.6.2
netCDF4: 1.5.7
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: None
cftime: 1.5.0
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: 3.3.2
cartopy: None
seaborn: None
numbagg: None
pint: None
setuptools: 52.0.0.post20210125
pip: 21.1.1
conda: None
pytest: None
IPython: 7.19.0
sphinx: None
The text was updated successfully, but these errors were encountered: