From 81a78e16e237aafab2d05ba4a82a0802affc76f7 Mon Sep 17 00:00:00 2001 From: Rupert Nash Date: Tue, 18 Jun 2024 14:07:54 +0100 Subject: [PATCH] Update for dependencies removing deprecations... --- .../converters/ExtractedPropertyUnstructuredGridReader.py | 2 +- python-tools/hlb/parsers/extraction.py | 2 +- python-tools/hlb/parsers/geometry/BaseSite.pyx | 2 +- python-tools/hlb/parsers/geometry/freeing.py | 2 +- python-tools/hlb/parsers/geometry/generic.py | 2 +- python-tools/tox.ini | 5 ++--- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/python-tools/hlb/converters/ExtractedPropertyUnstructuredGridReader.py b/python-tools/hlb/converters/ExtractedPropertyUnstructuredGridReader.py index d86277883..c37a63aee 100644 --- a/python-tools/hlb/converters/ExtractedPropertyUnstructuredGridReader.py +++ b/python-tools/hlb/converters/ExtractedPropertyUnstructuredGridReader.py @@ -118,7 +118,7 @@ def _CreateSkeleton(self, input_ug): selectors.AddNode(selector) # Perform the selection - extractSelection = vtk.vtkExtractSelectedIds() + extractSelection = vtk.vtkExtractSelection() extractSelection.SetInputData(0, input_ug) extractSelection.SetInputData(1, selectors) extractSelection.Update() diff --git a/python-tools/hlb/parsers/extraction.py b/python-tools/hlb/parsers/extraction.py index 0742d86d4..9689360a5 100644 --- a/python-tools/hlb/parsers/extraction.py +++ b/python-tools/hlb/parsers/extraction.py @@ -289,7 +289,7 @@ def _DetermineTimes(self): times[iT] = xdrlib.Unpacker(timeBuf).unpack_uhyper() continue - assert np.alltrue( + assert np.all( np.argsort(times) == np.arange(len(times)) ), "Times in extraction file are not monotonically increasing!" self.times = times diff --git a/python-tools/hlb/parsers/geometry/BaseSite.pyx b/python-tools/hlb/parsers/geometry/BaseSite.pyx index 47c801bdf..d452c882d 100644 --- a/python-tools/hlb/parsers/geometry/BaseSite.pyx +++ b/python-tools/hlb/parsers/geometry/BaseSite.pyx @@ -28,7 +28,7 @@ cdef public enum: WALL_NORMAL_AVAILABLE = 1 cdef class BaseSite: - def __init__(self, block, np.ndarray[np.int_t] sgIdx): + def __init__(self, block, np.ndarray[np.int64_t] sgIdx): self.GetBlock = weakref.ref(block) self.Index = sgIdx self.IntersectionType = None diff --git a/python-tools/hlb/parsers/geometry/freeing.py b/python-tools/hlb/parsers/geometry/freeing.py index 481a10ffb..fbc43b01a 100644 --- a/python-tools/hlb/parsers/geometry/freeing.py +++ b/python-tools/hlb/parsers/geometry/freeing.py @@ -102,7 +102,7 @@ def OnBlockProcessed(self, bIdx): self.OnBlockNeighboursProcessed(nIdx) pass continue - if np.alltrue(self.IsBlockDone): + if np.all(self.IsBlockDone): self.OnAllBlocksProcessed() return diff --git a/python-tools/hlb/parsers/geometry/generic.py b/python-tools/hlb/parsers/geometry/generic.py index 3cc36caee..d13a3b13f 100644 --- a/python-tools/hlb/parsers/geometry/generic.py +++ b/python-tools/hlb/parsers/geometry/generic.py @@ -21,7 +21,7 @@ def __init__(self, shape): """shape is the number of elements along each dimension of the array.""" - self.shape = np.array(shape).squeeze() + self.shape = np.array(shape, dtype=int).squeeze() self.ndim = len(self.shape) self._conv = np.array( [np.prod(self.shape[i:]) for i in range(1, self.ndim + 1)], dtype=int diff --git a/python-tools/tox.ini b/python-tools/tox.ini index 17d75c13e..ff5ad6e8e 100644 --- a/python-tools/tox.ini +++ b/python-tools/tox.ini @@ -1,14 +1,13 @@ [tox] -envlist = py36,py37,py38,py39,py10 +envlist = py38,py39,py310,py311 isolated_build = true [gh-actions] python = - 3.6: py36 - 3.7: py37 3.8: py38 3.9: py39 3.10: py310 + 3.11: py311 [testenv] deps = -rtest-requirements.txt