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:
Randy Döring
2024-08-22 01:53:57 +02:00
committed by GitHub
parent 3901d05d40
commit f7d1d8188c
10 changed files with 22 additions and 22 deletions

View File

@@ -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,