Helper Modules
Saving and loading objects
This module contains functions for saving and loading Z2Pack objects.
- z2pack.io.save(obj, file_path, serializer='auto')
Saves an object to the file given in
file_path
. The saving is made atomic (on systems whereos.replace()
is atomic) by first creating a temporary file and then moving to thefile_path
.
- z2pack.io.load(file_path, serializer='auto')
Loads the object that was saved to
file_path
.- Parameters:
file_path (str) – Path to the file.
serializer (module) – The serializer which should be used to load the result. By default, is deduced from the file extension. If no serializer is given and it cannot be deduced from the file ending, a
ValueError
is raised, to avoid loading corrupted data.
- z2pack.io.load(file_path, serializer='auto')
Loads the object that was saved to
file_path
.- Parameters:
file_path (str) – Path to the file.
serializer (module) – The serializer which should be used to load the result. By default, is deduced from the file extension. If no serializer is given and it cannot be deduced from the file ending, a
ValueError
is raised, to avoid loading corrupted data.
- z2pack.io.save(obj, file_path, serializer='auto')
Saves an object to the file given in
file_path
. The saving is made atomic (on systems whereos.replace()
is atomic) by first creating a temporary file and then moving to thefile_path
.
Shapes
This module contains pre-defined shapes to use as the surface
argument of surface.run()
or line
argument for line.run()
, defining the shape of the surface or line.