Skip to content

Commit

Permalink
MNT: Remove 3.8 compatibility, add 3.12, pin to major versions of num…
Browse files Browse the repository at this point in the history
…py and scipy. (#46)

* Remove depreciated function, pin to major versions of numpy and scipy.

* Remove 3.8 compatibility, add 3.12

* typo

* setup-miniconda@v3

* Try older numpy

* Fixes for numpy 2.

* Add quoates to requirments yaml.

* Reading the error this time.
  • Loading branch information
wtclarke authored Jun 28, 2024
1 parent 5123264 commit d4a4ec9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/push_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 1 addition & 3 deletions mapvbvd/mapVBVD.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mapvbvd/read_twix_hdr.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions requirements.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dependencies:
- numpy
- numpy>=1.26
- tqdm
- scipy
- scipy==1.13.*
- matplotlib
- h5py
- six
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

0 comments on commit d4a4ec9

Please sign in to comment.