diff --git a/.github/workflows/push_pr.yml b/.github/workflows/push_pr.yml index f55d6bb..651b8b3 100644 --- a/.github/workflows/push_pr.yml +++ b/.github/workflows/push_pr.yml @@ -12,13 +12,13 @@ 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: 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 }} 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/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..8b8b674 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,7 +1,7 @@ dependencies: - - numpy + - numpy>=1.26 - tqdm - - scipy + - 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')