Write a statepoint file.
filename (str or None) – Path to the statepoint to write. If None is passed, a default name that
contains the current batch will be written.
write_source (bool) – Whether or not to include the source bank in the statepoint.