From 59f806af3b41414f77c8d0c90e9dd09040f1c791 Mon Sep 17 00:00:00 2001 From: Alessandro Daducci Date: Tue, 9 Dec 2025 19:32:18 +0100 Subject: [PATCH 1/5] Removed upper bound to numpy<2.0.0 --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7741a0d..4d6f5cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] requires = [ "cython>=3.0.10", - "numpy>=1.24.4,<2.0.0", + "numpy>=1.24.4", "setuptools>=69.2.0" ] build-backend = "setuptools.build_meta" @@ -12,7 +12,7 @@ version = "2.4.2" dependencies = [ "dmri-amico>=2.0.1", "dmri-dicelib>=1.1.0", - "numpy>=1.24.4,<2.0.0", + "numpy>=1.24.4", "scipy>=1.10.1" ] requires-python = ">=3.8" From f9a45376da7603733b389ee129d4840081753447 Mon Sep 17 00:00:00 2001 From: Alessandro Daducci Date: Tue, 9 Dec 2025 20:48:44 +0100 Subject: [PATCH 2/5] Removed space in key name --- tests/test_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_demo.py b/tests/test_demo.py index ef2ab28..47ebf00 100644 --- a/tests/test_demo.py +++ b/tests/test_demo.py @@ -131,7 +131,7 @@ def check_results(pickle_result, ref_pickle): assert abs(result_optimization["fit_details"]["abs_cost"] - ref_optimization["fit_details"]["abs_cost"]) < 1e-4 assert abs(result_optimization["fit_details"]["rel_cost"] - ref_optimization["fit_details"]["rel_cost"]) < 1e-4 assert abs(result_optimization["fit_details"]["abs_x"] - ref_optimization["fit_details"]["abs_x"]) < 1e-4 - assert abs(result_optimization["fit_details"]["rel_x"] - ref_optimization["fit_details"]["rel _x"]) < 1e-4 #NOTE: There is a space in the key name + assert abs(result_optimization["fit_details"]["rel_x"] - ref_optimization["fit_details"]["rel_x"]) < 1e-4 assert result_optimization["fit_details"]["iterations"] == ref_optimization["fit_details"]["iterations"] except AssertionError: From f8d9f8c44f6a0fc14f5f1b5e1135ceabe257b769 Mon Sep 17 00:00:00 2001 From: Alessandro Daducci Date: Tue, 16 Dec 2025 11:07:15 +0100 Subject: [PATCH 3/5] Revert "Removed space in key name" This reverts commit f9a45376da7603733b389ee129d4840081753447. --- tests/test_demo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_demo.py b/tests/test_demo.py index 47ebf00..ef2ab28 100644 --- a/tests/test_demo.py +++ b/tests/test_demo.py @@ -131,7 +131,7 @@ def check_results(pickle_result, ref_pickle): assert abs(result_optimization["fit_details"]["abs_cost"] - ref_optimization["fit_details"]["abs_cost"]) < 1e-4 assert abs(result_optimization["fit_details"]["rel_cost"] - ref_optimization["fit_details"]["rel_cost"]) < 1e-4 assert abs(result_optimization["fit_details"]["abs_x"] - ref_optimization["fit_details"]["abs_x"]) < 1e-4 - assert abs(result_optimization["fit_details"]["rel_x"] - ref_optimization["fit_details"]["rel_x"]) < 1e-4 + assert abs(result_optimization["fit_details"]["rel_x"] - ref_optimization["fit_details"]["rel _x"]) < 1e-4 #NOTE: There is a space in the key name assert result_optimization["fit_details"]["iterations"] == ref_optimization["fit_details"]["iterations"] except AssertionError: From d0c95e4cfa198d82c6ca59a38e091e6c8c818dd8 Mon Sep 17 00:00:00 2001 From: Alessandro Daducci Date: Wed, 17 Dec 2025 10:27:18 +0100 Subject: [PATCH 4/5] Added explicit cast to be compatible with tests run with numpy v1 --- commit/trk2dictionary/trk2dictionary.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commit/trk2dictionary/trk2dictionary.pyx b/commit/trk2dictionary/trk2dictionary.pyx index 4b60d23..072968d 100644 --- a/commit/trk2dictionary/trk2dictionary.pyx +++ b/commit/trk2dictionary/trk2dictionary.pyx @@ -410,7 +410,8 @@ cpdef run( filename_tractogram=None, path_out=None, filename_peaks=None, filenam cdef float* ptrToVOXMM if extension == ".tck": M = _get_affine( niiREF ).copy() - M[:3, :3] = M[:3, :3].dot( np.diag([1./Px,1./Py,1./Pz]) ) + # float64 conversion added to comply with the new cast policy of numpy v2 + M[:3, :3] = M[:3, :3].dot( np.diag([np.float64(1)/Px,np.float64(1)/Py,np.float64(1)/Pz]) ) toVOXMM = np.ravel(np.linalg.inv(M)).astype(' Date: Wed, 17 Dec 2025 10:54:20 +0100 Subject: [PATCH 5/5] Updated CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b0e53f..224a79d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### 🐛Fixed - Error when checking the number of streamlines in the weighted LASSO function - Error in verifying voxel correspondence between the lesion mask passed through the dictionary and the ISO weights map +- Tests fail using numpy >= 2.0.0 --- ---