Skip to content

Commit

Permalink
Correct typing for _sparsearray (#8395)
Browse files Browse the repository at this point in the history
* Update _typing.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update _typing.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
Illviljan and pre-commit-ci[bot] authored Oct 31, 2023
1 parent 8a2f29b commit fcdc810
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions xarray/namedarray/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from collections.abc import Hashable, Iterable, Mapping, Sequence
from types import ModuleType
from typing import (
TYPE_CHECKING,
Any,
Callable,
Protocol,
Expand All @@ -16,10 +15,6 @@

import numpy as np

if TYPE_CHECKING:
from numpy.typing import NDArray


# https://stackoverflow.com/questions/74633074/how-to-type-hint-a-generic-numpy-array
_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
Expand Down Expand Up @@ -234,7 +229,7 @@ class _sparsearray(
Corresponds to np.ndarray.
"""

def todense(self) -> NDArray[_ScalarType_co]:
def todense(self) -> np.ndarray[Any, _DType_co]:
...


Expand Down

0 comments on commit fcdc810

Please sign in to comment.