Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: Remove depreciated function, pin to major versions of numpy and scipy. #46

Merged
merged 8 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')