From 71ac056f2ca0ee32f6ad5c19b326da83365b70d7 Mon Sep 17 00:00:00 2001 From: s233039 <s233039@student.dtu.dk> Date: Wed, 20 Nov 2024 13:43:11 +0100 Subject: [PATCH] Update saving docs --- qim3d/io/saving.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qim3d/io/saving.py b/qim3d/io/saving.py index 4ba7ef00..efc2333a 100644 --- a/qim3d/io/saving.py +++ b/qim3d/io/saving.py @@ -413,7 +413,8 @@ def save( """Save data to a specified file path. Args: - path (str): The path to save file to + path (str): The path to save file to. File format is chosen based on the extension. + Supported extensions are: <em>'.tif', '.tiff', '.nii', '.nii.gz', '.h5', '.vol', '.vgi', '.dcm', '.DCM', '.zarr', '.jpeg', '.jpg', '.png'</em> data (numpy.ndarray): The data to be saved replace (bool, optional): Specifies if an existing file with identical path should be replaced. Default is False. @@ -425,6 +426,13 @@ def save( as several files (only relevant for TIFF stacks). Default is 0, i.e., the first dimension. **kwargs: Additional keyword arguments to be passed to the DataSaver constructor + Raises: + ValueError: If the provided path is an existing directory and self.basename is not provided <strong>OR</strong> + If the file format is not supported <strong>OR</strong> + If the provided path does not exist and self.basename is not provided <strong>OR</strong> + If a file extension is not provided <strong>OR</strong> + if a file with the specified path already exists and replace=False. + Example: ```python import qim3d -- GitLab