issue_comments: 1000257950
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | performed_via_github_app | issue |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/pydata/xarray/issues/5671#issuecomment-1000257950 | https://api.github.com/repos/pydata/xarray/issues/5671 | 1000257950 | IC_kwDOAMm_X847nrme | 5088535 | 2021-12-23T12:03:09Z | 2021-12-23T12:03:09Z | NONE | I can confirm this issue when specifying dimensions with coordinates, as per this example: ``` import xarray as xr z = -1 x = [1, 2, 3] y = [4, 5, 6] data = [0, 0, 0] coords = {"z": z, "x": ("dim_0", x), "y": ("dim_0", y)} xr.DataArray(data, coords=coords) ``` MyPy output:
I can work around it by specifying the type of ``` from typing import Any, Hashable, Mapping import xarray as xr z = -1 x = [1, 2, 3] y = [4, 5, 6] data = [0, 0, 0] coords: Mapping[Hashable, Any] = {"z": z, "x": ("dim_0", x), "y": ("dim_0", y)} xr.DataArray(data, coords=coords) ```
There is some discussion about |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
959604710 |