@@ -603,20 +603,15 @@ def test_tractogram_copy(self):
603
603
604
604
# Check we copied the data and not simply created new references.
605
605
assert tractogram is not DATA ['tractogram' ]
606
- assert tractogram .streamlines is \
607
- not DATA ['tractogram' ].streamlines
608
- assert tractogram .data_per_streamline is \
609
- not DATA ['tractogram' ].data_per_streamline
610
- assert tractogram .data_per_point is \
611
- not DATA ['tractogram' ].data_per_point
606
+ assert tractogram .streamlines is not DATA ['tractogram' ].streamlines
607
+ assert tractogram .data_per_streamline is not DATA ['tractogram' ].data_per_streamline
608
+ assert tractogram .data_per_point is not DATA ['tractogram' ].data_per_point
612
609
613
610
for key in tractogram .data_per_streamline :
614
- assert tractogram .data_per_streamline [key ] is \
615
- not DATA ['tractogram' ].data_per_streamline [key ]
611
+ assert tractogram .data_per_streamline [key ] is not DATA ['tractogram' ].data_per_streamline [key ]
616
612
617
613
for key in tractogram .data_per_point :
618
- assert tractogram .data_per_point [key ] is \
619
- not DATA ['tractogram' ].data_per_point [key ]
614
+ assert tractogram .data_per_point [key ] is not DATA ['tractogram' ].data_per_point [key ]
620
615
621
616
# Check the values of the data are the same.
622
617
assert_tractogram_equal (tractogram , DATA ['tractogram' ])
@@ -818,8 +813,14 @@ def test_lazy_tractogram_creation(self):
818
813
# function.
819
814
with pytest .raises (TypeError ):
820
815
LazyTractogram (streamlines = streamlines )
816
+
817
+ with pytest .raises (TypeError ):
821
818
LazyTractogram (data_per_point = {"none" : None })
819
+
820
+ with pytest .raises (TypeError ):
822
821
LazyTractogram (data_per_streamline = data_per_streamline )
822
+
823
+ with pytest .raises (TypeError ):
823
824
LazyTractogram (streamlines = DATA ['streamlines' ],
824
825
data_per_point = data_per_point )
825
826
@@ -833,8 +834,8 @@ def test_lazy_tractogram_creation(self):
833
834
DATA ['data_per_streamline_func' ],
834
835
DATA ['data_per_point_func' ])
835
836
836
- assert is_lazy_dict (tractogram .data_per_streamline ) is True
837
- assert is_lazy_dict (tractogram .data_per_point ) is True
837
+ assert is_lazy_dict (tractogram .data_per_streamline )
838
+ assert is_lazy_dict (tractogram .data_per_point )
838
839
839
840
[t for t in tractogram ] # Force iteration through tractogram.
840
841
assert len (tractogram ) == len (DATA ['streamlines' ])
@@ -1010,15 +1011,12 @@ def test_lazy_tractogram_copy(self):
1010
1011
1011
1012
# When copying LazyTractogram, the generator function yielding
1012
1013
# streamlines should stay the same.
1013
- assert tractogram ._streamlines \
1014
- is DATA ['lazy_tractogram' ]._streamlines
1014
+ assert tractogram ._streamlines is DATA ['lazy_tractogram' ]._streamlines
1015
1015
1016
1016
# Copying LazyTractogram, creates new internal LazyDict objects,
1017
1017
# but generator functions contained in it should stay the same.
1018
- assert tractogram ._data_per_streamline \
1019
- is not DATA ['lazy_tractogram' ]._data_per_streamline
1020
- assert tractogram ._data_per_point \
1021
- is not DATA ['lazy_tractogram' ]._data_per_point
1018
+ assert tractogram ._data_per_streamline is not DATA ['lazy_tractogram' ]._data_per_streamline
1019
+ assert tractogram ._data_per_point is not DATA ['lazy_tractogram' ]._data_per_point
1022
1020
1023
1021
for key in tractogram .data_per_streamline :
1024
1022
data = tractogram .data_per_streamline .store [key ]
@@ -1031,8 +1029,7 @@ def test_lazy_tractogram_copy(self):
1031
1029
assert data is expected
1032
1030
1033
1031
# The affine should be a copy.
1034
- assert tractogram ._affine_to_apply \
1035
- is not DATA ['lazy_tractogram' ]._affine_to_apply
1032
+ assert tractogram ._affine_to_apply is not DATA ['lazy_tractogram' ]._affine_to_apply
1036
1033
assert_array_equal (tractogram ._affine_to_apply ,
1037
1034
DATA ['lazy_tractogram' ]._affine_to_apply )
1038
1035
0 commit comments