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

@@ -601,7 +601,7 @@ class FloatCanvas(wx.Panel):
"""
if N.sometrue(self.PanelSize <= 2 ):
if N.any(self.PanelSize <= 2 ):
# it's possible for this to get called before being properly initialized.
return
if self.Debug: start = clock()
@@ -779,7 +779,7 @@ class FloatCanvas(wx.Panel):
BoundingBox = self.BoundingBox
if (BoundingBox is not None) and (not BoundingBox.IsNull()):
self.ViewPortCenter = N.array(((BoundingBox[0,0]+BoundingBox[1,0])/2,
(BoundingBox[0,1]+BoundingBox[1,1])/2 ),N.float_)
(BoundingBox[0,1]+BoundingBox[1,1])/2 ),N.float64)
self.MapProjectionVector = self.ProjectionFun(self.ViewPortCenter)
# Compute the new Scale
BoundingBox = BoundingBox*self.MapProjectionVector # this does need to make a copy!