home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 765031152

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/pull/4818#issuecomment-765031152 https://api.github.com/repos/pydata/xarray/issues/4818 765031152 MDEyOklzc3VlQ29tbWVudDc2NTAzMTE1Mg== 10194086 2021-01-22T00:33:39Z 2021-01-22T00:33:39Z MEMBER

The following now works well

python import xarray as xr da = xr.DataArray([1]) reveal_type(xr.core.weighted.DataArrayWeighted(da, da).mean())

However, what I cannot get to work is:

python reveal_type(da.weighted(da)) (returns Any). What almost works is:

```python def weighted(self: T_DSorDA, weights: "DataArray") -> Weighted[T_DSorDA]:

return self._weighted_cls(self, weights)

```

However, mypy does not like that I overwrite the type of self with T_DSorDA...

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  787502146
Powered by Datasette · Queries took 1.316ms · About: xarray-datasette