Skip to content

Commit 6a6deca

Browse files
authored
Merge pull request #236 from jhlegarreta/fix/disallow-none-values-pet-init
FIX: Disallow `None` values when initializaing PET data object
2 parents fea6286 + 1d7cdd9 commit 6a6deca

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/nifreeze/data/pet.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,11 @@
4545
class PET(BaseDataset[np.ndarray | None]):
4646
"""Data representation structure for PET data."""
4747

48-
midframe: np.ndarray | None = attrs.field(
49-
default=None, repr=_data_repr, eq=attrs.cmp_using(eq=_cmp)
50-
)
48+
midframe: np.ndarray = attrs.field(default=None, repr=_data_repr, eq=attrs.cmp_using(eq=_cmp))
5149
"""A (N,) numpy array specifying the midpoint timing of each sample or frame."""
52-
total_duration: float | None = attrs.field(default=None, repr=True)
50+
total_duration: float = attrs.field(default=None, repr=True)
5351
"""A float representing the total duration of the dataset."""
54-
uptake: np.ndarray | None = attrs.field(
55-
default=None, repr=_data_repr, eq=attrs.cmp_using(eq=_cmp)
56-
)
52+
uptake: np.ndarray = attrs.field(default=None, repr=_data_repr, eq=attrs.cmp_using(eq=_cmp))
5753
"""A (N,) numpy array specifying the uptake value of each sample or frame."""
5854

5955
def _getextra(self, idx: int | slice | tuple | np.ndarray) -> tuple[np.ndarray | None]:

0 commit comments

Comments
 (0)