write_to_file does not close file
Closed this issue · 0 comments
SchroederSa commented
When executing these lines twice, the write call fails.
laser = Laser("rt", (-100e-6, -40e-6/sc.c), (100e-6, 40e-6/sc.c), (Nr, Nz), lasy_profile, n_azimuthal_modes = 2)
laser.write_to_file("test/laser")
110 env.reset_dataset(dataset)
111 env.store_chunk(data)
--> 113 series.flush()
RuntimeError: [HDF5] Internal error: Failed to create HDF5 file
The reason for this is, that the written file is not closed with series.close()
cc @ax3l