Skip to content

Commit

Permalink
add illiffe astype function
Browse files Browse the repository at this point in the history
  • Loading branch information
AWehrhahn committed Apr 6, 2022
1 parent db6d338 commit 441f3f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pysme/iliffe_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,11 @@ def from_indices(cls, array, indices):
arr = [array[l:u] for l, u in zip(offsets[:-1], offsets[1:])]
return cls(arr)

def astype(self, dtype):
data = self.data.astype(dtype)
offsets = self.offsets
return Iliffe_vector(data, offsets, dtype=dtype)

# For IO with Flex
def _prepare(self, name: str):
cls = self.__class__
Expand Down

0 comments on commit 441f3f8

Please sign in to comment.