Skip to content

Commit

Permalink
Fix numpy 2 compatibility issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmeyer committed Oct 23, 2024
1 parent dffc204 commit 82c95f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nion/instrumentation/Acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3459,7 +3459,7 @@ def __init__(self, start: float, stop: float, num: int) -> None:
self.stop = stop
self.num = num

def __array__(self, dtype: typing.Optional[numpy.typing.DTypeLike] = None) -> numpy.typing.NDArray[typing.Any]:
def __array__(self, dtype: typing.Optional[numpy.typing.DTypeLike] = None, copy: typing.Optional[bool] = None) -> numpy.typing.NDArray[typing.Any]:
return numpy.linspace(self.start, self.stop, self.num, dtype=dtype)


Expand All @@ -3471,7 +3471,7 @@ def __init__(self, y_space: numpy.typing.ArrayLike, x_space: numpy.typing.ArrayL
self.y_space = y_space
self.x_space = x_space

def __array__(self, dtype: typing.Optional[numpy.typing.DTypeLike] = None) -> numpy.typing.NDArray[typing.Any]:
def __array__(self, dtype: typing.Optional[numpy.typing.DTypeLike] = None, copy: typing.Optional[bool] = None) -> numpy.typing.NDArray[typing.Any]:
return numpy.stack(numpy.meshgrid(numpy.array(self.y_space), numpy.array(self.x_space), indexing='ij'), axis=-1)


Expand Down

0 comments on commit 82c95f3

Please sign in to comment.