Skip to content

Commit 0dff054

Browse files
authored
Merge pull request #255 from nipy/fix/198
FIX: Remove implementation of an abstract class
2 parents 81ecff8 + 0831499 commit 0dff054

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

nitransforms/base.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
from pathlib import Path
1212
import numpy as np
13-
import h5py
1413
import warnings
1514
from nibabel.loadsave import load as _nbload
1615
from nibabel import funcs as _nbfuncs
@@ -333,15 +332,9 @@ def map(self, x, inverse=False):
333332
"""
334333
return x
335334

336-
def to_filename(self, filename, fmt="X5"):
335+
def to_filename(self, filename, fmt="X5", moving=None, x5_inverse=False):
337336
"""Store the transform in BIDS-Transforms HDF5 file format (.x5)."""
338-
with h5py.File(filename, "w") as out_file:
339-
out_file.attrs["Format"] = "X5"
340-
out_file.attrs["Version"] = np.uint16(1)
341-
root = out_file.create_group("/0")
342-
self._to_hdf5(root)
343-
344-
return filename
337+
raise NotImplementedError
345338

346339
def _to_hdf5(self, x5_root):
347340
"""Serialize this object into the x5 file format."""

nitransforms/tests/test_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def _to_hdf5(klass, x5_root):
108108
_ = xfm.ndim
109109

110110
# Test to_filename
111-
xfm.to_filename("data.x5")
111+
with pytest.raises(NotImplementedError):
112+
xfm.to_filename("data.x5")
112113

113114
# Test identity transform
114115
xfm = nitl.Affine()

0 commit comments

Comments
 (0)