From bb45d6ce88261723931f83e196ba571830f1e974 Mon Sep 17 00:00:00 2001 From: Jerome Kieffer Date: Mon, 25 Mar 2024 18:07:41 +0100 Subject: [PATCH] fix numpy2 compatibility --- src/fabio/OXDimage.py | 2 +- src/fabio/test/codecs/test_esperantoimage.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fabio/OXDimage.py b/src/fabio/OXDimage.py index 80fb02f26..6b5ea2321 100644 --- a/src/fabio/OXDimage.py +++ b/src/fabio/OXDimage.py @@ -482,7 +482,7 @@ def dec_TY5(self, stream): dim2 = self._shape[0] while pos_inp < stream_size and pos_out < array_size: if pos_out % dim2 == 0: - last = 0 + last = numpy.int64(0) else: last = current value = raw[pos_inp] diff --git a/src/fabio/test/codecs/test_esperantoimage.py b/src/fabio/test/codecs/test_esperantoimage.py index 9d70f9d10..c5d9aa5ca 100644 --- a/src/fabio/test/codecs/test_esperantoimage.py +++ b/src/fabio/test/codecs/test_esperantoimage.py @@ -134,7 +134,7 @@ def test_data(self): def test_values(self): esp = fabio.open(UtilsTest.getimage("reference.esperanto.bz2")[:-4]) npy = fabio.open(UtilsTest.getimage("reference.npy.bz2")[:-4]) - self.assertEqual(numpy.alltrue(esp.data == npy.data), True, "Images are the same") + self.assertEqual(numpy.all(esp.data == npy.data), True, "Images are the same") def suite():