Skip to content

Commit cfa394f

Browse files
committed
TST: Fix dummy dataset dunder methods in estimator test
Fix dummy dataset dunder methods in estimator test: - Return the correct dataset length: the length is the value along the last dimension. - Return the correct volume given an index: the index value indexes the dataset along the last axis. Take advantage of the commit to return `None` as the value for the motion affines, as it can either be an array or `None`, not a scalar.
1 parent d27ba75 commit cfa394f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_estimator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ def __init__(self, rng):
4747
self.affine = np.eye(4)
4848

4949
def __len__(self):
50-
return len(self.dataobj)
50+
return self.dataobj.shape[-1]
5151

5252
def __getitem__(self, idx):
5353
# Return a valid 3D array and a dummy value
54-
return self.dataobj[idx], 1
54+
return self.dataobj[..., idx], None
5555

5656
def set_transform(self, idx, matrix):
5757
pass

0 commit comments

Comments
 (0)