diff --git a/CHANGELOG.md b/CHANGELOG.md index ba29ef9..0614810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This document contains the Spec2nii release history in reverse chronological ord - Modified repository structure. Siemens and Philips files now have dedicated directories. - Support Python 3.11 - Enable automatic Pypi upload and move to pyproject.toml file build. +- Bruker conversion currently limited to numpy installations <1.20.0. Awaiting brukerapi package update. 0.4.9 (Friday 4th November 2022) -------------------------------- diff --git a/spec2nii/spec2nii.py b/spec2nii/spec2nii.py index 8d034a1..f777eb9 100644 --- a/spec2nii/spec2nii.py +++ b/spec2nii/spec2nii.py @@ -33,6 +33,10 @@ # There are case specific imports below +class Spec2niiError(Exception): + pass + + class spec2nii: def __init__(self): cite_str = "Clarke WT, Bell TK, Emir UE, Mikkelsen M, Oeltzschner G, Shamaei A, Soher BJ, Wilson M. "\ @@ -521,7 +525,16 @@ def raw(self, args): # Bruker 2dseq files with FG_COMPLEX def bruker(self, args): from spec2nii.bruker import read_bruker - self.imageOut, self.fileoutNames = read_bruker(args) + from warnings import warn + from brukerapi.exceptions import MissingProperty + warn('Bruker conversion must currently be run with numpy<1.20.0') + + try: + self.imageOut, self.fileoutNames = read_bruker(args) + except MissingProperty: + raise Spec2niiError( + 'Bruker conversion must currently be run with numpy<1.20.0. ' + 'The underlying brukerapi package requires updating for ongoing compatibility.') # Varian parser def varian(self, args): diff --git a/tests/test_bruker.py b/tests/test_bruker.py index 8d4ff7e..4760988 100644 --- a/tests/test_bruker.py +++ b/tests/test_bruker.py @@ -9,6 +9,7 @@ import json import numpy as np +import pytest from .io_for_tests import read_nifti_mrs @@ -17,6 +18,7 @@ data_path = bruker_path / '20201208_105201_lego_rod_1_3' +@pytest.mark.skip(reason="Awaiting fix of brukerapi package") def test_fid(tmp_path): subprocess.check_call(['spec2nii', 'bruker', @@ -94,6 +96,7 @@ def test_fid(tmp_path): assert 'acqp' in hdr_ext +@pytest.mark.skip(reason="Awaiting fix of brukerapi package") def test_2dseq(tmp_path): subprocess.check_call(['spec2nii', 'bruker',