Skip to content

Commit 009b999

Browse files
committed
Fix for numpy 2.3
1 parent 67a8876 commit 009b999

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

galsim/image.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1794,7 +1794,10 @@ def __pow__(self, other):
17941794
def __ipow__(self, other):
17951795
if not isinstance(other, int) and not isinstance(other, float):
17961796
raise TypeError("Can only raise an image to a float or int power!")
1797-
self.array[:,:] **= other
1797+
if not self.isinteger or isinstance(other, int):
1798+
self.array[:,:] **= other
1799+
else:
1800+
self.array[:,:] = self._safe_cast(self.array ** other)
17981801
return self
17991802

18001803
def __neg__(self):

0 commit comments

Comments
 (0)