Skip to content
Snippets Groups Projects

First version of save function + unit tests

+ 0
12
@@ -8,12 +8,6 @@ from qim3d.io.logger import log
class DataSaver:
"""Utility class for saving data to different file formats.
Args:
replace (bool, optional): Specifies if an existing file with identical path should be replaced.
Default is False.
compression (bool, optional): Specifies if the file should be saved with Deflate compression.
Default is False.
Attributes:
replace (bool): Specifies if an existing file with identical path is replaced.
compression (bool): Specifies if the file is with Deflate compression.
@@ -22,12 +16,6 @@ class DataSaver:
save_tiff(path,data): Save data to a TIFF file to the given path.
load(path,data): Save data to the given path.
Raises:
ValueError: If the file format is not supported.
ValueError: If the specified folder does not exist.
ValueError: If a file extension is not provided.
ValueError: if a file with the specified path already exists and replace=False.
Example:
image = qim3d.examples.blobs_256x256
saver = qim3d.io.DataSaver(compression=True)
Loading