mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-15 17:20:07 +01:00
Fix NumPy 2.0 deprecations via running ruff (#2580)
* Fix NumPy 2.0 deprecations via running `ruff check --select NPY201 --fix --exclude docs/sphinx/rest_substitutions/snippets/python/converted` See https://numpy.org/devdocs/numpy_2_0_migration_guide.html#numpy-2-0-migration-guide * Use `numpy.any` instead of `any` because the latter does not work for multidimensional arrays.
This commit is contained in:
@@ -160,7 +160,7 @@ class TriangleShape1(FC.Polygon, MovingObjectMixin):
|
||||
Points = N.array(((0, c),
|
||||
( L/2.0, -c/2.0),
|
||||
(-L/2.0, -c/2.0)),
|
||||
N.float_)
|
||||
N.float64)
|
||||
|
||||
Points += XY
|
||||
return Points
|
||||
|
||||
@@ -64,7 +64,7 @@ class TriangleShape1(FC.Polygon, ShapeMixin):
|
||||
Points = N.array(((0, c),
|
||||
( L/2.0, -c/2.0),
|
||||
(-L/2.0, -c/2.0)),
|
||||
N.float_)
|
||||
N.float64)
|
||||
|
||||
Points += XY
|
||||
return Points
|
||||
@@ -104,7 +104,7 @@ class DrawFrame(wx.Frame):
|
||||
Points = N.array(((0,0),
|
||||
(1,0),
|
||||
(0.5, 1)),
|
||||
N.float_)
|
||||
N.float64)
|
||||
|
||||
data = (( (0,0), 1),
|
||||
( (3,3), 2),
|
||||
|
||||
@@ -112,7 +112,7 @@ class DrawFrame(wx.Frame):
|
||||
dc.SetPen(wx.Pen('WHITE', 2, wx.SHORT_DASH))
|
||||
dc.SetLogicalFunction(wx.XOR)
|
||||
if self.SelectedPointNeighbors is None:
|
||||
self.SelectedPointNeighbors = N.zeros((3,2), N.float_)
|
||||
self.SelectedPointNeighbors = N.zeros((3,2), N.float64)
|
||||
#fixme: This feels very inelegant!
|
||||
if Index == 0:
|
||||
self.SelectedPointNeighbors[0] = self.SelectedPoly.Points[-1]
|
||||
|
||||
@@ -212,7 +212,7 @@ class TriangleShape1(FC.Polygon, MovingObjectMixin):
|
||||
Points = N.array(((0, c),
|
||||
( L/2.0, -c/2.0),
|
||||
(-L/2.0, -c/2.0)),
|
||||
N.float_)
|
||||
N.float64)
|
||||
|
||||
Points += XY
|
||||
return Points
|
||||
|
||||
@@ -188,7 +188,7 @@ class DrawFrame(wx.Frame):
|
||||
Family = wx.ROMAN,
|
||||
Alignment = "right"
|
||||
)
|
||||
Point = N.array((100, -20), N.float_)
|
||||
Point = N.array((100, -20), N.float64)
|
||||
Box = Canvas.AddScaledTextBox("Here is even more auto wrapped text. This time the line spacing is set to 0.8. \n\nThe Padding is set to 0.",
|
||||
Point,
|
||||
Size = 3,
|
||||
@@ -202,7 +202,7 @@ class DrawFrame(wx.Frame):
|
||||
)
|
||||
Canvas.AddPoint(Point, "Red", 2)
|
||||
|
||||
Point = N.array((0, -40), N.float_)
|
||||
Point = N.array((0, -40), N.float64)
|
||||
# Point = N.array((0, 0), N.float_)
|
||||
for Position in ["tl", "bl", "tr", "br"]:
|
||||
# for Position in ["br"]:
|
||||
@@ -221,7 +221,7 @@ class DrawFrame(wx.Frame):
|
||||
)
|
||||
Canvas.AddPoint(Point, "Red", 4)
|
||||
|
||||
Point = N.array((-20, 60), N.float_)
|
||||
Point = N.array((-20, 60), N.float64)
|
||||
Box = Canvas.AddScaledTextBox("Here is some\ncentered\ntext",
|
||||
Point,
|
||||
Size = 4,
|
||||
@@ -237,7 +237,7 @@ class DrawFrame(wx.Frame):
|
||||
LineSpacing = 0.8
|
||||
)
|
||||
|
||||
Point = N.array((-20, 20), N.float_)
|
||||
Point = N.array((-20, 20), N.float64)
|
||||
Box = Canvas.AddScaledTextBox("Here is some\nright aligned\ntext",
|
||||
Point,
|
||||
Size = 4,
|
||||
@@ -252,7 +252,7 @@ class DrawFrame(wx.Frame):
|
||||
LineSpacing = 0.8
|
||||
)
|
||||
|
||||
Point = N.array((100, -60), N.float_)
|
||||
Point = N.array((100, -60), N.float64)
|
||||
Box = Canvas.AddScaledTextBox("Here is some auto wrapped text. This time it is centered, rather than right aligned.\n\nThe Padding is set to 2.",
|
||||
Point,
|
||||
Size = 3,
|
||||
|
||||
@@ -204,7 +204,7 @@ class TriangleShape1(FC.Polygon, MovingObjectMixin):
|
||||
Points = N.array(((0, c),
|
||||
( L/2.0, -c/2.0),
|
||||
(-L/2.0, -c/2.0)),
|
||||
N.float_)
|
||||
N.float64)
|
||||
|
||||
Points += XY
|
||||
return Points
|
||||
|
||||
Reference in New Issue
Block a user