@@ -127,17 +127,13 @@ def setup():
127
127
affine_to_rasmm = np .eye (4 ))
128
128
129
129
DATA ['streamlines_func' ] = lambda : (e for e in DATA ['streamlines' ])
130
- fa_func = lambda : (e for e in DATA ['fa' ])
131
- colors_func = lambda : (e for e in DATA ['colors' ])
132
- mean_curvature_func = lambda : (e for e in DATA ['mean_curvature' ])
133
- mean_torsion_func = lambda : (e for e in DATA ['mean_torsion' ])
134
- mean_colors_func = lambda : (e for e in DATA ['mean_colors' ])
135
-
136
- DATA ['data_per_point_func' ] = {'colors' : colors_func ,
137
- 'fa' : fa_func }
138
- DATA ['data_per_streamline_func' ] = {'mean_curvature' : mean_curvature_func ,
139
- 'mean_torsion' : mean_torsion_func ,
140
- 'mean_colors' : mean_colors_func }
130
+ DATA ['data_per_point_func' ] = {
131
+ 'colors' : lambda : (e for e in DATA ['colors' ]),
132
+ 'fa' : lambda : (e for e in DATA ['fa' ])}
133
+ DATA ['data_per_streamline_func' ] = {
134
+ 'mean_curvature' : lambda : (e for e in DATA ['mean_curvature' ]),
135
+ 'mean_torsion' : lambda : (e for e in DATA ['mean_torsion' ]),
136
+ 'mean_colors' : lambda : (e for e in DATA ['mean_colors' ])}
141
137
142
138
DATA ['lazy_tractogram' ] = LazyTractogram (DATA ['streamlines_func' ],
143
139
DATA ['data_per_streamline_func' ],
@@ -742,8 +738,8 @@ def test_lazy_tractogram_creation(self):
742
738
# Streamlines and other data as generators
743
739
streamlines = (x for x in DATA ['streamlines' ])
744
740
data_per_point = {"colors" : (x for x in DATA ['colors' ])}
745
- data_per_streamline = {'mean_torsion ' : (x for x in DATA ['mean_torsion' ]),
746
- 'mean_colors ' : (x for x in DATA ['mean_colors' ])}
741
+ data_per_streamline = {'torsion ' : (x for x in DATA ['mean_torsion' ]),
742
+ 'colors ' : (x for x in DATA ['mean_colors' ])}
747
743
748
744
# Creating LazyTractogram with generators is not allowed as
749
745
# generators get exhausted and are not reusable unlike generator
@@ -773,9 +769,7 @@ def test_lazy_tractogram_creation(self):
773
769
774
770
def test_lazy_tractogram_from_data_func (self ):
775
771
# Create an empty `LazyTractogram` yielding nothing.
776
- _empty_data_gen = lambda : iter ([])
777
-
778
- tractogram = LazyTractogram .from_data_func (_empty_data_gen )
772
+ tractogram = LazyTractogram .from_data_func (lambda : iter ([]))
779
773
check_tractogram (tractogram )
780
774
781
775
# Create `LazyTractogram` from a generator function yielding
@@ -930,12 +924,14 @@ def test_lazy_tractogram_copy(self):
930
924
is not DATA ['lazy_tractogram' ]._data_per_point )
931
925
932
926
for key in tractogram .data_per_streamline :
933
- assert_true (tractogram .data_per_streamline .store [key ]
934
- is DATA ['lazy_tractogram' ].data_per_streamline .store [key ])
927
+ data = tractogram .data_per_streamline .store [key ]
928
+ expected = DATA ['lazy_tractogram' ].data_per_streamline .store [key ]
929
+ assert_true (data is expected )
935
930
936
931
for key in tractogram .data_per_point :
937
- assert_true (tractogram .data_per_point .store [key ]
938
- is DATA ['lazy_tractogram' ].data_per_point .store [key ])
932
+ data = tractogram .data_per_point .store [key ]
933
+ expected = DATA ['lazy_tractogram' ].data_per_point .store [key ]
934
+ assert_true (data is expected )
939
935
940
936
# The affine should be a copy.
941
937
assert_true (tractogram ._affine_to_apply
0 commit comments