From 6f0f176ab6af92121006f5313105d38f9062147e Mon Sep 17 00:00:00 2001 From: wtclarke Date: Wed, 3 Jul 2024 08:50:06 +0100 Subject: [PATCH] Drop python 3.8 support, add 3.12, deal with numpy 2.0 --- .github/workflows/push_pr.yml | 2 +- CHANGELOG.md | 5 +++++ requirements.yml | 8 ++++---- setup.py | 4 ++-- spec2nii/Philips/philips_dcm.py | 4 ++-- spec2nii/uih.py | 2 +- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index 9caa5d5..f05b272 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: ["ubuntu-latest"] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: [ "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 41feb85..f4d4d43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ This document contains the Spec2nii release history in reverse chronological order. +0.8.0 (Wednesday 3rd July 2024) +------------------------------- +- Dropped support for Python 3.8 (EOL imminent), added support and testing for 3.12. +- Compatibility with Numpy 2.0 + 0.7.4 (Thursday 18th April 2024) -------------------------------- - Refinements and improvements to the GE SVS pipeline from Mark Mikkelsen. diff --git a/requirements.yml b/requirements.yml index 4e0f419..70d583c 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,9 +1,9 @@ dependencies: - - numpy + - numpy>=1.26 - nibabel - pydicom - - pyMapVBVD>=0.5.2 - - scipy + - pyMapVBVD>=0.6.0 + - scipy==1.13.* - brukerapi>=0.1.8 - pandas - - nifti-mrs>=1.1.1 + - nifti-mrs>=1.3.0 diff --git a/setup.py b/setup.py index 2fcc029..61871f0 100644 --- a/setup.py +++ b/setup.py @@ -27,13 +27,13 @@ install_requires=install_requires, classifiers=[ "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent"], - python_requires='>=3.8', + python_requires='>=3.9', entry_points={"console_scripts": [ "spec2nii = spec2nii.spec2nii:main"]}, package_data={'spec2nii': ['bruker_properties.json', diff --git a/spec2nii/Philips/philips_dcm.py b/spec2nii/Philips/philips_dcm.py index 79127a2..0c8e16f 100644 --- a/spec2nii/Philips/philips_dcm.py +++ b/spec2nii/Philips/philips_dcm.py @@ -40,7 +40,7 @@ def svs_or_CSI(img): if img.image_shape is None \ and img.dcm_data.VolumeLocalizationTechnique == 'NONE': return 'FID' - elif np.product(img.image_shape) > 1.0: + elif np.prod(img.image_shape) > 1.0: return 'CSI' else: return 'SVS' @@ -53,7 +53,7 @@ def svs_or_CSI(img): if img.image_shape is None \ and img.dcm_data.VolumeLocalizationTechnique == 'NONE': return 'FID' - elif np.product([columns, rows, slices]) > 1.0: + elif np.prod([columns, rows, slices]) > 1.0: return 'CSI' else: return 'SVS' diff --git a/spec2nii/uih.py b/spec2nii/uih.py index 8f1664e..05fee4a 100644 --- a/spec2nii/uih.py +++ b/spec2nii/uih.py @@ -21,7 +21,7 @@ def svs_or_CSI(img): """Identify from the headers whether data is CSI or SVS.""" # Currently this only looks in-plane. I don't have examples of CSI from # UIH. - if np.product(img.image_shape) > 1.0: + if np.prod(img.image_shape) > 1.0: return 'CSI' else: return 'SVS'