pysdic.SDICAnalysis.to_archive#
- SDICAnalysis.to_archive(file_path, *, overwrite=False, make_dirs=False, compress=False, title=None, description=None, export_vtk=False)[source]#
Save the analysis in a single ZIP archive, to reload it exactly with
from_archive().The archive contains exactly the files of
to_folder()(at its root), includingmanifest.json: the integrity of the content is checked at the loading. It is written in a temporary folder next tofile_pathand renamed at the end, so an existing archive is unchanged if an error occurs.- Parameters:
file_path (Union[str, os.PathLike]) – The archive to create (for example
"test_42.analysis.zip").overwrite (bool, optional (default:
False)) – If True, an existing file is replaced (a folder is never replaced).make_dirs (bool, optional (default:
False)) – If True, the missing parent folders are created.compress (bool, optional (default:
False)) – If True, the files are compressed (ZIP_DEFLATED): smaller but slower. By default they are stored (ZIP_STORED).title (str | None) – See
to_folder().description (str | None) – See
to_folder().export_vtk (bool) – See
to_folder().
- Raises:
FileExistsError – If
file_pathexists andoverwriteis False, or if it is a folder.FileNotFoundError – If the parent folder does not exist and
make_dirsis False.
- Return type:
None