From ae33272fc355e5160d6f6adabbc50f8300641247 Mon Sep 17 00:00:00 2001 From: wtclarke Date: Thu, 27 Jun 2024 18:26:47 +0100 Subject: [PATCH 1/8] Remove depreciated function, pin to major versions of numpy and scipy. --- mapvbvd/read_twix_hdr.py | 4 ++-- requirements.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mapvbvd/read_twix_hdr.py b/mapvbvd/read_twix_hdr.py index 6f6bbc6..374e895 100644 --- a/mapvbvd/read_twix_hdr.py +++ b/mapvbvd/read_twix_hdr.py @@ -1,6 +1,6 @@ import re import numpy as np -from scipy.integrate import cumtrapz +from scipy.integrate import cumulative_trapezoid from mapvbvd._attrdict import AttrDict @@ -231,7 +231,7 @@ def read_twix_hdr(fid, prot): # make sure that gr_adc is always positive (rstraj needs to be strictly monotonic) gr_adc = np.maximum(gr_adc, 1e-4) - rstraj = (np.append(0, cumtrapz(gr_adc)) - ncol / 2) / np.sum(gr_adc) + rstraj = (np.append(0, cumulative_trapezoid(gr_adc)) - ncol / 2) / np.sum(gr_adc) rstraj -= np.mean(rstraj[int(ncol / 2) - 1:int(ncol / 2) + 1]) # scale rstraj by kmax (only works if all slices have same FoV!!!) # TODO: these are examples of the keys not arranged correctly diff --git a/requirements.yml b/requirements.yml index c9ba00d..e083dc0 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,7 +1,7 @@ dependencies: - - numpy + - numpy==2.* - tqdm - - scipy + - scipy==1.14.* - matplotlib - h5py - six From 4d097dffadd07bc3611c7fa9700d889667b86327 Mon Sep 17 00:00:00 2001 From: wtclarke Date: Fri, 28 Jun 2024 11:25:56 +0100 Subject: [PATCH 2/8] Remove 3.8 compatibility, add 3.12 --- .github/workflows/push_pr.yml | 2 +- requirements.yml | 2 +- setup.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index f55d6bb..d8bd9d4 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.11"] steps: - uses: actions/checkout@v4 with: diff --git a/requirements.yml b/requirements.yml index e083dc0..8e7424b 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,7 +1,7 @@ dependencies: - numpy==2.* - tqdm - - scipy==1.14.* + - scipy==1.13.* - matplotlib - h5py - six diff --git a/setup.py b/setup.py index c439ad0..3932c29 100644 --- a/setup.py +++ b/setup.py @@ -31,10 +31,10 @@ license_file='LICENSE', 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 :: MIT License", "Operating System :: OS Independent", ], - python_requires='>=3.8') + python_requires='>=3.9') From ebcb53a387f3e79dbd8e389813f627b61ec34671 Mon Sep 17 00:00:00 2001 From: wtclarke Date: Fri, 28 Jun 2024 11:27:13 +0100 Subject: [PATCH 3/8] typo --- .github/workflows/push_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index d8bd9d4..4c11908 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.9", "3.10", "3.11", "3.11"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 with: From d7f4cfc5e863444c041721211b9e3625f3729368 Mon Sep 17 00:00:00 2001 From: wtclarke Date: Fri, 28 Jun 2024 11:47:34 +0100 Subject: [PATCH 4/8] setup-miniconda@v3 --- .github/workflows/push_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index 4c11908..651b8b3 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -18,7 +18,7 @@ jobs: with: submodules: true lfs: true - - uses: conda-incubator/setup-miniconda@v2 + - uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true python-version: ${{ matrix.python-version }} From 130f3e1d090ac8af98fbf665dda566dcb6e7d938 Mon Sep 17 00:00:00 2001 From: wtclarke Date: Fri, 28 Jun 2024 12:03:12 +0100 Subject: [PATCH 5/8] Try older numpy --- requirements.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.yml b/requirements.yml index 8e7424b..08475b1 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,5 +1,5 @@ dependencies: - - numpy==2.* + - numpy==1.26.* - tqdm - scipy==1.13.* - matplotlib From f813b479746c918f18616a2cee5345515f68680b Mon Sep 17 00:00:00 2001 From: wtclarke Date: Fri, 28 Jun 2024 18:07:05 +0100 Subject: [PATCH 6/8] Fixes for numpy 2. --- CHANGELOG.md | 6 ++++++ mapvbvd/mapVBVD.py | 4 +--- requirements.yml | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 748fb66..94d7eec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ This document contains the pymapvbvd release history in reverse chronological order. +0.6.0 (Friday 28th June 2024) +----------------------------- +- Dropped support for Python 3.8 +- Testing for Python 3.12 +- Compatibility with Numpy version 2 + 0.5.7 (Wednesday 31st January 2024) ----------------------------------- - Added flag to disable line reflection. Thanks to FrankZijlstra for contributing. diff --git a/mapvbvd/mapVBVD.py b/mapvbvd/mapVBVD.py index caf4e52..48bb343 100644 --- a/mapvbvd/mapVBVD.py +++ b/mapvbvd/mapVBVD.py @@ -132,9 +132,7 @@ def loop_mdh_read(fid, version, Nscans, scan, measOffset, measLength, print_prog # the "DMA length" # if mdh.ulPackBit # it seems that the packbit is not always set correctly - tmp = data_u8[dmaIdx] - tmp.dtype = np.uint16 - NCol_NCha = tmp # was float [ushSamplesInScan ushUsedChannels] + NCol_NCha = data_u8[dmaIdx].view(np.uint16).astype(int) ulDMALength = dmaOff + (8 * NCol_NCha[0] + dmaSkip) * NCol_NCha[1] n_acq = n_acq + 1 diff --git a/requirements.yml b/requirements.yml index 08475b1..35fb20b 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,5 +1,5 @@ dependencies: - - numpy==1.26.* + - numpy>=1.26.* - tqdm - scipy==1.13.* - matplotlib From 62d38444f2225a8a6d5af43641fdeb091dfa251b Mon Sep 17 00:00:00 2001 From: wtclarke Date: Fri, 28 Jun 2024 18:11:19 +0100 Subject: [PATCH 7/8] Add quoates to requirments yaml. --- requirements.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.yml b/requirements.yml index 35fb20b..21e0de3 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,7 +1,7 @@ dependencies: - - numpy>=1.26.* + - "numpy>=1.26.*" - tqdm - - scipy==1.13.* + - "scipy==1.13.*" - matplotlib - h5py - six From 034e339457db0f00329d9fbba925caa260bd43e8 Mon Sep 17 00:00:00 2001 From: wtclarke Date: Fri, 28 Jun 2024 18:15:16 +0100 Subject: [PATCH 8/8] Reading the error this time. --- requirements.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.yml b/requirements.yml index 21e0de3..8b8b674 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,7 +1,7 @@ dependencies: - - "numpy>=1.26.*" + - numpy>=1.26 - tqdm - - "scipy==1.13.*" + - scipy==1.13.* - matplotlib - h5py - six