File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -293,10 +293,10 @@ def _get_breaks_cached(
293293 # Determine the stop indices of the preferred chunks, but omit the last stop
294294 # (equal to the dim size). In particular, assume that when a sequence
295295 # expresses the preferred chunks, the sequence sums to the size.
296- preferred_stops = set (
296+ preferred_stops = (
297297 range (preferred_chunk_sizes , size , preferred_chunk_sizes )
298298 if isinstance (preferred_chunk_sizes , int )
299- else itertools .accumulate (preferred_chunk_sizes [:- 1 ])
299+ else set ( itertools .accumulate (preferred_chunk_sizes [:- 1 ]) )
300300 )
301301
302302 # Gather any stop indices of the specified chunks that are not a stop index
@@ -307,8 +307,7 @@ def _get_breaks_cached(
307307 actual_stops_2 = itertools .accumulate (chunk_sizes [:- 1 ])
308308
309309 disagrees = itertools .compress (
310- actual_stops_2 ,
311- (a not in preferred_stops for a in actual_stops ),
310+ actual_stops_2 , (a not in preferred_stops for a in actual_stops )
312311 )
313312 try :
314313 return next (disagrees )
You can’t perform that action at this time.
0 commit comments