Open file immediately in `write()`
We currently run the simulation before calling write()
, which means that after a long simulation time, we get errors related to the opening/writing of the file. We should open the file first thing (and raise errors if any), before going to heavy the computations of simulate()
.