We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 69f30dc commit 4a40d64Copy full SHA for 4a40d64
1 file changed
src/squidpy/datasets/_utils.py
@@ -185,7 +185,11 @@ def _extension(self) -> str:
185
def _get_zipped_dataset(folderpath: Path, dataset_name: str, figshare_id: str) -> sd.SpatialData:
186
"""Returns a specific dataset as SpatialData object. If the file is not present on disk, it will be downloaded and extracted."""
187
188
- if not folderpath.is_dir():
+ # Create directory if it doesn't exist
189
+ if not folderpath.exists():
190
+ logg.info(f"Creating directory `{folderpath}`")
191
+ folderpath.mkdir(parents=True, exist_ok=True)
192
+ elif not folderpath.is_dir():
193
raise ValueError(f"Expected a directory path for `folderpath`, found: {folderpath}")
194
195
download_zip = folderpath / f"{dataset_name}.zip"
0 commit comments