Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Illviljan <14371165+Illviljan@users.noreply.github.com>
  • Loading branch information
kmuehlbauer and Illviljan authored Apr 2, 2023
1 parent 106231f commit f6b58e4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions xarray/coding/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ class NativeEndiannessArray(indexing.ExplicitlyIndexedNDArrayMixin):

__slots__ = ("array",)

def __init__(self, array):
def __init__(self, array) -> None:
self.array = indexing.as_indexable(array)

@property
def dtype(self):
def dtype(self) -> np.dtype:
return np.dtype(self.array.dtype.kind + str(self.array.dtype.itemsize))

def __getitem__(self, key):
def __getitem__(self, key) -> np.ndarray:
return np.asarray(self.array[key], dtype=self.dtype)


Expand All @@ -132,14 +132,14 @@ class BoolTypeArray(indexing.ExplicitlyIndexedNDArrayMixin):

__slots__ = ("array",)

def __init__(self, array):
def __init__(self, array) -> None:
self.array = indexing.as_indexable(array)

@property
def dtype(self):
def dtype(self) -> np.dtype:
return np.dtype("bool")

def __getitem__(self, key):
def __getitem__(self, key) -> np.ndarray:
return np.asarray(self.array[key], dtype=self.dtype)


Expand Down

0 comments on commit f6b58e4

Please sign in to comment.