From 899fb73b33cb6976c39a42ba26a31cf2acde63ee Mon Sep 17 00:00:00 2001 From: Hind-M Date: Wed, 25 May 2022 16:53:04 +0200 Subject: Add info in the doc concerning default data_home and 'GUDHI_DATA' env variable --- src/python/doc/datasets.rst | 3 +++ src/python/gudhi/datasets/remote.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) (limited to 'src/python') diff --git a/src/python/doc/datasets.rst b/src/python/doc/datasets.rst index 8b0912c4..2d11a19d 100644 --- a/src/python/doc/datasets.rst +++ b/src/python/doc/datasets.rst @@ -112,6 +112,9 @@ Fetching datasets We provide some ready-to-use datasets that are not available by default when getting GUDHI, and need to be fetched explicitly. +By **default**, the fetched datasets directory is set to a folder named **'gudhi_data'** in the **user home folder**. +Alternatively, it can be set using the **'GUDHI_DATA'** environment variable. + .. autofunction:: gudhi.datasets.remote.fetch_bunny .. figure:: ./img/bunny.png diff --git a/src/python/gudhi/datasets/remote.py b/src/python/gudhi/datasets/remote.py index 7e6f647f..48bdcfa6 100644 --- a/src/python/gudhi/datasets/remote.py +++ b/src/python/gudhi/datasets/remote.py @@ -143,6 +143,7 @@ def _get_archive_path(file_path, label): def fetch_spiral_2d(file_path = None): """ Fetch spiral_2d dataset remotely. + Note that if the dataset already exists in the target location, it is not downloaded again, and the corresponding array is returned from cache. @@ -150,8 +151,12 @@ def fetch_spiral_2d(file_path = None): ---------- file_path : string Full path of the downloaded file including filename. + Default is None, meaning that it's set to "data_home/points/spiral_2d/spiral_2d.npy". + The "data_home" directory is set by default to "~/gudhi_data", + unless the 'GUDHI_DATA' environment variable is set. + Returns ------- points: numpy array @@ -170,7 +175,9 @@ def fetch_spiral_2d(file_path = None): def fetch_bunny(file_path = None, accept_license = False): """ Fetch Stanford bunny dataset remotely and its LICENSE file. + This dataset contains 35947 vertices. + Note that if the dataset already exists in the target location, it is not downloaded again, and the corresponding array is returned from cache. @@ -178,10 +185,16 @@ def fetch_bunny(file_path = None, accept_license = False): ---------- file_path : string Full path of the downloaded file including filename. + Default is None, meaning that it's set to "data_home/points/bunny/bunny.npy". In this case, the LICENSE file would be downloaded as "data_home/points/bunny/bunny.LICENSE". + + The "data_home" directory is set by default to "~/gudhi_data", + unless the 'GUDHI_DATA' environment variable is set. + accept_license : boolean Flag to specify if user accepts the file LICENSE and prevents from printing the corresponding license terms. + Default is False. Returns -- cgit v1.2.3