home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 531478548

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/3298#issuecomment-531478548 https://api.github.com/repos/pydata/xarray/issues/3298 531478548 MDEyOklzc3VlQ29tbWVudDUzMTQ3ODU0OA== 5635139 2019-09-14T13:08:45Z 2019-09-14T13:08:45Z MEMBER

Here's a solution to the mypy issue:

```diff diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 1d762114..ee4ebf4d 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -2046,8 +2046,8 @@ class Dataset(Mapping, ImplementsDatasetReduce, DataWithCoords): raise TypeError("indexer value must be an integer") elif v < 0: raise ValueError("indexer value must be positive") - indexers = {k: slice(val) for k, val in indexers.items()} - return self.isel(indexers) + indexers_slices = {k: slice(val) for k, val in indexers.items()} + return self.isel(indexers_slices)

 def tail(
     self,

@@ -2087,11 +2087,11 @@ class Dataset(Mapping, ImplementsDatasetReduce, DataWithCoords): raise TypeError("indexer value must be an integer") elif v < 0: raise ValueError("indexer value must be positive") - indexers = { + indexers_slices = { k: slice(-val, None) if val != 0 else slice(val) for k, val in indexers.items() } - return self.isel(indexers) + return self.isel(indexers_slices)

 def thin(
     self,

@@ -2134,8 +2134,8 @@ class Dataset(Mapping, ImplementsDatasetReduce, DataWithCoords): raise ValueError("indexer value must be positive") elif v == 0: raise ValueError("step cannot be zero") - indexers = {k: slice(None, None, val) for k, val in indexers.items()} - return self.isel(indexers) + indexers_slices = {k: slice(None, None, val) for k, val in indexers.items()} + return self.isel(indexers_slices)

 def broadcast_like(
     self, other: Union["Dataset", "DataArray"], exclude: Iterable[Hashable] = None

```

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