issues: 959604710
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
959604710 | MDU6SXNzdWU5NTk2MDQ3MTA= | 5671 | Fix typing for coords argument in DataArray | 22784297 | closed | 0 | 3 | 2021-08-03T23:04:41Z | 2021-12-23T19:54:57Z | 2021-12-23T19:54:57Z | NONE | ProblemMypy reports errors on anything other than a list of tuples passed to CodeContained in file t = np.linspace(0, 2*np.pi, 12) tv = xr.Variable('time', t) # line 5 d2sin = xr.DataArray(np.sin(2 * tv), coords=[('time', t)]) # using tuple mypy column error detect here ----vdsin = xr.DataArray(np.sin(tv), coords=[tv]) # using xr.Variable dcos = xr.DataArray(np.cos(tv), coords=[dsin['time']]) # using xr.DataArray print(f"Types:\n\t{type(tv)=}\n\t{type(dsin['time'])=}") # line 12 print("d2sin:", d2sin) print("dsin:", dsin) print("dcos:", dcos) ``` Running Python
Running MyPy
EnvironmentOutput of <tt>xr.show_versions()</tt>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 |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/5671/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |