Skip to content

Commit af43bb6

Browse files
committed
updated to use validated_property and BinaryFile
1 parent 447e7a1 commit af43bb6

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

.github/workflows/ci-cd.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,19 @@ jobs:
115115
--log-errors
116116
--latest
117117
- name: Upload MRtrix3 install
118-
uses: actions/upload-artifact@v2
118+
uses: actions/upload-artifact@v4
119119
with:
120120
name: MRtrix3
121121
path: ${{ env.MRTRIX_INSTALL}}
122122
- name: Upload auto-gen pydra
123-
uses: actions/upload-artifact@v2
123+
uses: actions/upload-artifact@v4
124124
with:
125125
name: AutoGen
126126
path: pydra/tasks/mrtrix3/${{ env.SUBPKG_NAME }}
127127
- name: Write version file
128128
run: echo $MRTRIX_VERSION > mrtrix3_version.txt
129129
- name: Upload version file
130-
uses: actions/upload-artifact@v2
130+
uses: actions/upload-artifact@v4
131131
with:
132132
name: VersionFile
133133
path: mrtrix3_version.txt
@@ -352,7 +352,7 @@ jobs:
352352
git tag -d ${{ steps.latest_tag.outputs.TAG }};
353353
git tag -a ${{ steps.latest_tag.outputs.TAG }} -m"Tag used to create a pydra-mrtrix3 $MRTRIX_VERSION release";
354354
- name: Set up Python 3.11
355-
uses: actions/setup-python@v2
355+
uses: actions/setup-python@v3
356356
with:
357357
python-version: 3.11
358358
- name: Install build tools
@@ -362,7 +362,7 @@ jobs:
362362
- name: Check distributions
363363
run: twine check dist/*
364364
- name: Upload sdist
365-
uses: actions/upload-artifact@v2
365+
uses: actions/upload-artifact@v4
366366
with:
367367
name: SDist
368368
path: dist/*.tar.gz

related-packages/fileformats/fileformats/medimage_mrtrix3/dwi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from fileformats.core import validated_property
12
from fileformats.core.mixin import WithAdjacentFiles
23
from fileformats.medimage import DwiEncoding, Nifti1, NiftiGz, NiftiX, NiftiGzX
34
from .image import ImageFormat, ImageHeader, ImageFormatGz
@@ -11,7 +12,7 @@ class BFile(DwiEncoding):
1112

1213
# NIfTI file format gzipped with BIDS side car
1314
class WithBFile(WithAdjacentFiles):
14-
@property
15+
@validated_property
1516
def encoding(self) -> BFile:
1617
return BFile(self.select_by_ext(BFile))
1718

related-packages/fileformats/fileformats/medimage_mrtrix3/image.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pathlib import Path
22
import typing as ty
3-
from fileformats.core import FileSet, extra_implementation
4-
from fileformats.generic import File
3+
from fileformats.core import FileSet, extra_implementation, validated_property
4+
from fileformats.generic import BinaryFile
55
from fileformats.application.archive import BaseGzip
66
from fileformats.core.mixin import WithMagicNumber
77
from fileformats.core.exceptions import FormatMismatchError
@@ -12,12 +12,12 @@ class MultiLineMetadataValue(list):
1212
pass
1313

1414

15-
class BaseMrtrixImage(WithMagicNumber, fileformats.medimage.MedicalImage, File):
15+
class BaseMrtrixImage(WithMagicNumber, fileformats.medimage.MedicalImage, BinaryFile):
1616

1717
magic_number = b"mrtrix image\n"
1818
binary = True
1919

20-
@property
20+
@validated_property
2121
def data_fspath(self):
2222
data_fspath = self.metadata["file"].split()[0]
2323
if data_fspath == ".":
@@ -48,8 +48,8 @@ class ImageFormat(BaseMrtrixImage):
4848
ext = ".mif"
4949
iana_mime = "application/x-mrtrix-image-format"
5050

51-
@property
52-
def check_data_file(self):
51+
@validated_property
52+
def _check_data_file(self):
5353
if self.data_fspath != self.fspath:
5454
raise FormatMismatchError(
5555
f"Data file ('{self.data_fspath}') is not set to the same file as header "
@@ -73,7 +73,7 @@ class ImageHeader(BaseMrtrixImage):
7373
ext = ".mih"
7474
iana_mime = "application/x-mrtrix-image-header"
7575

76-
@property
76+
@validated_property
7777
def data_file(self):
7878
return ImageDataFile(self.data_fspath)
7979

@@ -84,7 +84,7 @@ def __attrs_post_init__(self):
8484
super().__attrs_post_init__()
8585

8686

87-
class ImageDataFile(File):
87+
class ImageDataFile(BinaryFile):
8888

8989
ext = ".dat"
9090

related-packages/fileformats/fileformats/medimage_mrtrix3/track.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from fileformats.generic import File
1+
from fileformats.generic import BinaryFile
22
from fileformats.core.mixin import WithMagicNumber
33

44

5-
class Tracks(WithMagicNumber, File):
5+
class Tracks(WithMagicNumber, BinaryFile):
66

77
ext = ".tck"
88
magic_number = b"mrtrix tracks\n"

0 commit comments

Comments
 (0)