Skip to content

Commit 2ccb387

Browse files
committed
Fix for numpy 2.3
1 parent a812324 commit 2ccb387

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
@@ -1789,7 +1789,10 @@ def __pow__(self, other):
17891789
def __ipow__(self, other):
17901790
if not isinstance(other, int) and not isinstance(other, float):
17911791
raise TypeError("Can only raise an image to a float or int power!")
1792-
self.array[:,:] **= other
1792+
if not self.isinteger or isinstance(other, int):
1793+
self.array[:,:] **= other
1794+
else:
1795+
self.array[:,:] = self._safe_cast(self.array ** other)
17931796
return self
17941797

17951798
def __neg__(self):

0 commit comments

Comments
 (0)