@@ -967,18 +967,17 @@ def read(self, frames: int = -1, dtype: str = 'float64',
967967 """
968968 if out is None :
969969 frames = self ._check_frames (frames , fill_value )
970- actual_out = self ._create_empty_array (frames , always_2d , dtype )
970+ out = self ._create_empty_array (frames , always_2d , dtype )
971971 else :
972972 if frames < 0 or frames > len (out ):
973973 frames = len (out )
974- actual_out = out
975- frames = self ._array_io ('read' , actual_out , frames )
976- if len (actual_out ) > frames :
974+ frames = self ._array_io ('read' , out , frames )
975+ if len (out ) > frames :
977976 if fill_value is None :
978- actual_out = actual_out [:frames ]
977+ out = out [:frames ]
979978 else :
980- actual_out [frames :] = fill_value
981- return actual_out
979+ out [frames :] = fill_value
980+ return out
982981
983982
984983 def buffer_read (self , frames : int = - 1 , dtype : Optional [str ] = None ) -> memoryview :
@@ -1192,37 +1191,36 @@ def blocks(self, blocksize: Optional[int] = None, overlap: int = 0,
11921191 if blocksize is None :
11931192 raise TypeError ("One of {blocksize, out} must be specified" )
11941193 out_size = blocksize if fill_value is not None else min (blocksize , frames )
1195- actual_out = self ._create_empty_array (out_size , always_2d , dtype )
1194+ out = self ._create_empty_array (out_size , always_2d , dtype )
11961195 copy_out = True
11971196 else :
11981197 if blocksize is not None :
11991198 raise TypeError (
12001199 "Only one of {blocksize, out} may be specified" )
12011200 blocksize = len (out )
12021201 copy_out = False
1203- actual_out = out
12041202
12051203 overlap_memory = None
12061204 while frames > 0 :
12071205 if overlap_memory is None :
12081206 output_offset = 0
12091207 else :
12101208 output_offset = len (overlap_memory )
1211- actual_out [:output_offset ] = overlap_memory
1209+ out [:output_offset ] = overlap_memory
12121210
12131211 toread = min (blocksize - output_offset , frames )
1214- self .read (toread , dtype , always_2d , fill_value , actual_out [output_offset :])
1212+ self .read (toread , dtype , always_2d , fill_value , out [output_offset :])
12151213
12161214 if overlap :
12171215 if overlap_memory is None :
1218- overlap_memory = np .copy (actual_out [- overlap :])
1216+ overlap_memory = np .copy (out [- overlap :])
12191217 else :
1220- overlap_memory [:] = actual_out [- overlap :]
1218+ overlap_memory [:] = out [- overlap :]
12211219
12221220 if blocksize > frames + overlap and fill_value is None :
1223- block = actual_out [:frames + overlap ]
1221+ block = out [:frames + overlap ]
12241222 else :
1225- block = actual_out
1223+ block = out
12261224 yield np .copy (block ) if copy_out else block
12271225 frames -= toread
12281226
0 commit comments