summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHind-M <hind.montassif@gmail.com>2022-05-25 16:53:04 +0200
committerHind-M <hind.montassif@gmail.com>2022-05-25 16:53:04 +0200
commit899fb73b33cb6976c39a42ba26a31cf2acde63ee (patch)
treecd91d41cefa1b4e5218bc9465178120313d02c9a /src
parentce34ee3e5c28c48d605f23332cfa3c10e471a047 (diff)
Add info in the doc concerning default data_home and 'GUDHI_DATA' env variable
Diffstat (limited to 'src')
-rw-r--r--src/python/doc/datasets.rst3
-rw-r--r--src/python/gudhi/datasets/remote.py13
2 files changed, 16 insertions, 0 deletions
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