@@ -255,19 +255,16 @@ def nocompile(*args, **kwargs):
255
255
[[4.0 , 2.56 , 6283.08 ]])
256
256
}
257
257
258
-
259
- TABLE_1_DICT ['L1' ].resize ((64 , 3 ))
260
- TABLE_1_DICT ['L2' ].resize ((64 , 3 ))
261
- TABLE_1_DICT ['L3' ].resize ((64 , 3 ))
262
- TABLE_1_DICT ['L4' ].resize ((64 , 3 ))
263
- TABLE_1_DICT ['L5' ].resize ((64 , 3 ))
264
-
265
- TABLE_1_DICT ['B1' ].resize ((5 , 3 ))
266
-
267
- TABLE_1_DICT ['R1' ].resize ((40 , 3 ))
268
- TABLE_1_DICT ['R2' ].resize ((40 , 3 ))
269
- TABLE_1_DICT ['R3' ].resize ((40 , 3 ))
270
- TABLE_1_DICT ['R4' ].resize ((40 , 3 ))
258
+ resize_mapping = {
259
+ 'L1' : (64 , 3 ), 'L2' : (64 , 3 ), 'L3' : (64 , 3 ), 'L4' : (64 , 3 ), 'L5' : (64 , 3 ),
260
+ 'B1' : (5 , 3 ), 'R1' : (40 , 3 ), 'R2' : (40 , 3 ), 'R3' : (40 , 3 ), 'R4' : (40 , 3 )}
261
+
262
+ # make arrays uniform size for efficient broadcasting in numba, fill with 0s
263
+ # np.resize does not work because it fills with repeated copies
264
+ for key , dims in resize_mapping .items ():
265
+ new_rows = dims [0 ] - TABLE_1_DICT [key ].shape [0 ]
266
+ TABLE_1_DICT [key ] = np .append (TABLE_1_DICT [key ], np .zeros ((new_rows , 3 )),
267 + axis = 0 )
271
268
272
269
273
270
HELIO_LONG_TABLE = np .array ([TABLE_1_DICT ['L0' ],
0 commit comments