An ugly hack to convince newer version of numpy to save list of arrays
This commit is contained in:
parent
e5270b54fb
commit
3a2fc6685c
|
@ -260,10 +260,15 @@ if not math.isnan(a.ccd_distance):
|
|||
logging.info("Far fields done")
|
||||
|
||||
outfile = defaultprefix + ".npz" if a.output is None else a.output
|
||||
for sir in scattered_ir:# An ugly hack to convince newer versions of numpy that we indeed want to save a list of arrays
|
||||
if sir is None:
|
||||
break
|
||||
else:
|
||||
scattered_ir.append(None)
|
||||
np.savez(outfile, meta={**vars(a), 'qpms_version' : qpms.__version__()},
|
||||
omega=omega, wavenumber=wavenumber, nelem=nelem, wavevector=np.array(a.wavevector), phases=phases,
|
||||
positions = ss.positions[:,:2],
|
||||
scattered_ir_packed = np.array(scattered_ir, dtype=np.object),
|
||||
scattered_ir_packed = np.array(scattered_ir, dtype=object),
|
||||
scattered_full = scattered_full,
|
||||
ir_contained = ir_contained,
|
||||
t=t, l=l, m=m,
|
||||
|
|
Loading…
Reference in New Issue