File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -248,18 +248,16 @@ def measure_program(
248248
249249 # Sort results by window
250250 total_samples = 0
251+ window_boundries = numpy .insert (numpy .cumsum (self ._armed_sample_windows [:, 0 ]), 0 , 0 )
251252 for i , window_name in enumerate (self ._armed_window_names ):
252- n_samples = int (
253- self ._armed_sample_windows [i , 0 ] * self ._armed_sample_windows [i , 1 ]
254- )
255- samples = self ._samples_raw [total_samples : total_samples + n_samples :]
256- results = self ._results_raw [:, total_samples : total_samples + n_samples :]
253+ samples = self ._samples_raw [numpy .where ((self ._samples_raw >= window_boundries [i ]) * (self ._samples_raw < window_boundries [i + 1 ]))[0 ]]
254+ results = self ._results_raw [:, numpy .where ((self ._samples_raw >= window_boundries [i ]) * (self ._samples_raw < window_boundries [i + 1 ]))[0 ]]
257255
258256 if self ._results .get (window_name ) == None :
259257 self ._results [window_name ] = []
260258
261259 self ._results [window_name ] += [[samples , results ]]
262- total_samples += n_samples
260+ total_samples += len ( samples )
263261
264262 # Compile result dict
265263 result_dict = {}
You can’t perform that action at this time.
0 commit comments