mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-06 20:10:08 +01:00
Handle deprecated NumPy type aliases in samples
These aliases were deprecated in numpy 1.20.0 (January 2021), and removed in 1.24.0 (December 2022) This helps with NumPy 2 support (June 2024). Fixes: numpy-deprecated-type-alias (NPY001) Ruff rule to help transition: https://docs.astral.sh/ruff/rules/numpy-deprecated-type-alias/
This commit is contained in:
@@ -27,7 +27,7 @@ def YScaleFun(center):
|
||||
"""
|
||||
|
||||
# center gets ignored in this case
|
||||
return np.array((1, float(NumChannels)/MaxValue), np.float)
|
||||
return np.array((1, float(NumChannels)/MaxValue), float)
|
||||
|
||||
def ScaleWorldToPixel(self, Lengths):
|
||||
"""
|
||||
@@ -41,7 +41,7 @@ def ScaleWorldToPixel(self, Lengths):
|
||||
Lengths should be a NX2 array of (x,y) coordinates, or
|
||||
a 2-tuple, or sequence of 2-tuples.
|
||||
"""
|
||||
return np.ceil(( (np.asarray(Lengths, np.float)*self.TransformVector) )).astype('i')
|
||||
return np.ceil(( (np.asarray(Lengths, float)*self.TransformVector) )).astype('i')
|
||||
|
||||
|
||||
class DrawFrame(wx.Frame):
|
||||
|
||||
Reference in New Issue
Block a user