You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The whole reason I'd like to use this package is to have in editor suggestions when working with Xarray. However, even the case provided in the README does not work in the current 1.6.0 version. In particular, the following code produces an error with basic type checking.
from dataclasses import dataclass
from typing import Literal
from xarray_dataclasses import AsDataArray, Coord, Data
X = Literal["x"]
Y = Literal["y"]
@dataclass
class Image(AsDataArray):
"""2D image as DataArray."""
data: Data[tuple[X, Y], float]
x: Coord[X, int] = 0
y: Coord[Y, int] = 0
image = Image.new([[2.0, 2.0], [2.0, 2.0]], x=[0, 1], y=[0, 1])
Argument of type "list[list[float]]" cannot be assigned to parameter "data" of type "Data[tuple[X, Y], float]"
"list[float]" is incompatible with "float"
"list[float]" is incompatible with "float"Pylance[reportGeneralTypeIssues](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportGeneralTypeIssues)
The text was updated successfully, but these errors were encountered:
The whole reason I'd like to use this package is to have in editor suggestions when working with Xarray. However, even the case provided in the README does not work in the current
1.6.0
version. In particular, the following code produces an error with basic type checking.The text was updated successfully, but these errors were encountered: