set_pickle_format#
- set_pickle_format(format: Literal['vtk', 'xml', 'legacy']) None[source]#
Set the format used to serialize
pyvista.DataObjectwhen pickled.Note
This controls the in-memory pickle protocol used by
DataObject.__getstate__/__setstate__for cross-process serialization (multiprocessing,dask,joblib). It does not enable a.pklmesh file format. PyVista refuses.pkl/.pickleextensions inpyvista.read()andsave()because unpickling untrusted files is arbitrary code execution.- Parameters:
- format
str The format for serialization. Acceptable values are:
'vtk'(default)objects are serialized using VTK’s officialmarshalling methods.
'xml': objects are serialized as an XML-formatted string.'legacy'objects are serialized to bytes in VTK’s binary format.
Note
The
'vtk'format requires VTK 9.3 or greater.Warning
'xml'and'legacy'are not recommended. These formats are not officially supported by VTK and have limitations. For example, these formats cannot be used to picklepyvista.MultiBlock.
- format
- Raises:
ValueErrorIf the provided format is not supported.