From 8bf00db6bba18874cebd0112b029308b96d13759 Mon Sep 17 00:00:00 2001 From: Kelvin Chow Date: Tue, 20 Jan 2026 16:26:25 -0700 Subject: [PATCH 1/5] Fix compatibility with xsdata 26.1 As described in https://github.com/tefra/xsdata/pull/1128 --- requirements.txt | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 89b3e99..001a40a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ h5py==3.14.0 pytest==8.4.1 numpy==2.3.2 -xsdata==25.7 \ No newline at end of file +xsdata==26.1 \ No newline at end of file diff --git a/setup.py b/setup.py index be0a21b..c4b284f 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ def generate_schema(self, schema_filename, config_filename, subpackage_name, out import sys import subprocess # subpackage_name = 'ismrmrdschema' - args = [sys.executable, '-m', 'xsdata', str(schema_filename), '--config', str(config_filename), '--package', subpackage_name] + args = [sys.executable, '-m', 'xsdata', 'generate', str(schema_filename), '--config', str(config_filename), '--package', subpackage_name] subprocess.run(args) self.fix_init_file(subpackage_name, f"{subpackage_name}/__init__.py") destination = os.path.join(outdir, subpackage_name) @@ -66,7 +66,7 @@ def generate_schema(self, schema_filename, config_filename, subpackage_name, out shutil.move(subpackage_name, destination) setup( - version='1.14.2', + version='1.14.3', packages=find_packages(), cmdclass={ 'generate_schema': GenerateSchemaCommand From 5d944c283b7ac5363ecf98cbd3ac4d204fcfcf4d Mon Sep 17 00:00:00 2001 From: Kelvin Chow Date: Thu, 3 Jul 2025 18:42:30 -0600 Subject: [PATCH 2/5] Add definition of IMTYPE_RGB --- ismrmrd/constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ismrmrd/constants.py b/ismrmrd/constants.py index 451be1d..e22aef5 100644 --- a/ismrmrd/constants.py +++ b/ismrmrd/constants.py @@ -68,6 +68,7 @@ IMTYPE_REAL = 3 IMTYPE_IMAG = 4 IMTYPE_COMPLEX = 5 +IMTYPE_RGB = 6 # Image flags IMAGE_IS_NAVIGATION_DATA = 1 From bdc0c8eb056dce1e987faf20c203b59581fc038a Mon Sep 17 00:00:00 2001 From: Kelvin Chow Date: Thu, 3 Jul 2025 18:41:25 -0600 Subject: [PATCH 3/5] Add option to specify mode when opening h5 files to allow read-only access --- ismrmrd/hdf5.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ismrmrd/hdf5.py b/ismrmrd/hdf5.py index f391128..f0eb5ee 100644 --- a/ismrmrd/hdf5.py +++ b/ismrmrd/hdf5.py @@ -144,12 +144,15 @@ def fileinfo(fname): class Dataset(object): - def __init__(self, filename, dataset_name="dataset", create_if_needed=True): + def __init__(self, filename, dataset_name="dataset", create_if_needed=True, mode=None): # Open the file - if create_if_needed: - self._file = h5py.File(filename, 'a') - else: - self._file = h5py.File(filename, 'r+') + if mode is None: + if create_if_needed: + mode = 'a' + else: + mode = 'r+' + + self._file = h5py.File(filename, mode) self._dataset_name = dataset_name From eeaa2a45ee823c2d70c3439cc032762df908cfad Mon Sep 17 00:00:00 2001 From: Kelvin Chow Date: Thu, 3 Jul 2025 18:50:30 -0600 Subject: [PATCH 4/5] Raise exception if the number of samples exceeds the limit for Waveforms --- ismrmrd/waveform.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ismrmrd/waveform.py b/ismrmrd/waveform.py index f128ffa..936f47f 100644 --- a/ismrmrd/waveform.py +++ b/ismrmrd/waveform.py @@ -69,6 +69,9 @@ def from_array(data, **kwargs): channels, nsamples = data.shape + if nsamples > np.iinfo(np.uint16).max: + raise TypeError(f"Array has {nsamples} samples, which is greater than the maximum of {np.iinfo(np.uint16).max}") + array_data = { 'version': 1, 'channels': channels, From bf8a7c95d51cc88f055bd940f48606e307999811 Mon Sep 17 00:00:00 2001 From: Kelvin Chow Date: Tue, 20 Jan 2026 17:00:54 -0700 Subject: [PATCH 5/5] Remove deprecated macOS 13 GitHub action --- .github/workflows/ismrmrd_python_conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ismrmrd_python_conda.yml b/.github/workflows/ismrmrd_python_conda.yml index aa0b240..d0c30e1 100644 --- a/.github/workflows/ismrmrd_python_conda.yml +++ b/.github/workflows/ismrmrd_python_conda.yml @@ -12,7 +12,7 @@ jobs: build-conda-packages: strategy: matrix: - os: [ubuntu-latest, macos-latest, macos-13] + os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v5