summaryrefslogtreecommitdiff
path: root/src/python/doc
diff options
context:
space:
mode:
authorHind-M <hind.montassif@gmail.com>2021-09-22 15:20:03 +0200
committerHind-M <hind.montassif@gmail.com>2021-09-22 15:20:03 +0200
commite23ca84fadcc2c65fd8cf2d141be804bf18b2fd6 (patch)
treed33da76449f363df2c2d1c8f5d2981596c7e5163 /src/python/doc
parent65619d48af98680294bf41c4023e04ee94f2745d (diff)
Rename function of torus cpp version and import it with sphere in points
Change documentation accordingly
Diffstat (limited to 'src/python/doc')
-rw-r--r--src/python/doc/datasets_generators.rst28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/python/doc/datasets_generators.rst b/src/python/doc/datasets_generators.rst
index e63dde82..c0bbb973 100644
--- a/src/python/doc/datasets_generators.rst
+++ b/src/python/doc/datasets_generators.rst
@@ -13,10 +13,12 @@ We provide the generation of different customizable datasets to use as inputs fo
Points generators
------------------
+The module **points** enables the generation of random points on a sphere, random points on a torus and as a grid.
+
Points on sphere
^^^^^^^^^^^^^^^^
-The module **_points** enables the generation of random i.i.d. points uniformly on a (d-1)-sphere in :math:`R^d`.
+The function **sphere** enables the generation of random i.i.d. points uniformly on a (d-1)-sphere in :math:`R^d`.
The user should provide the number of points to be generated on the sphere :code:`n_samples` and the ambient dimension :code:`ambient_dim`.
The :code:`radius` of sphere is optional and is equal to **1** by default.
Only random points generation is currently available.
@@ -28,28 +30,28 @@ Example
.. code-block:: python
- from gudhi.datasets.generators import _points
+ from gudhi.datasets.generators import points
from gudhi import AlphaComplex
# Generate 50 points on a sphere in R^2
- gen_points = _points.sphere(n_samples = 50, ambient_dim = 2, radius = 1, sample = "random")
+ gen_points = points.sphere(n_samples = 50, ambient_dim = 2, radius = 1, sample = "random")
# Create an alpha complex from the generated points
alpha_complex = AlphaComplex(points = gen_points)
-.. autofunction:: gudhi.datasets.generators._points.sphere
+.. autofunction:: gudhi.datasets.generators.points.sphere
Points on torus
^^^^^^^^^^^^^^^^
You can also generate points on a torus.
-Two modules are available and give the same output: the first one depends on **CGAL** and the second does not and consists of full python code.
+Two functions are available and give the same output: the first one depends on **CGAL** and the second does not and consists of full python code.
On another hand, two sample types are provided : you can either generate i.i.d. points on a d-torus in :math:`R^{2d}` *randomly* or on a *grid*.
-First module : **_points**
-""""""""""""""""""""""""""
+First function : **ctorus**
+"""""""""""""""""""""""""""
The user should provide the number of points to be generated on the torus :code:`n_samples`, and the dimension :code:`dim` of the torus on which points would be generated in :math:`R^{2dim}`.
The :code:`sample` argument is optional and is set to **'random'** by default.
@@ -67,18 +69,18 @@ Example
"""""""
.. code-block:: python
- from gudhi.datasets.generators import _points
+ from gudhi.datasets.generators import points
# Generate 50 points randomly on a torus in R^6
- gen_points = _points.torus(n_samples = 50, dim = 3)
+ gen_points = points.ctorus(n_samples = 50, dim = 3)
# Generate 27 points on a torus as a grid in R^6
- gen_points = _points.torus(n_samples = 50, dim = 3, sample = 'grid')
+ gen_points = points.ctorus(n_samples = 50, dim = 3, sample = 'grid')
-.. autofunction:: gudhi.datasets.generators._points.torus
+.. autofunction:: gudhi.datasets.generators.points.ctorus
-Second module : **points**
-""""""""""""""""""""""""""
+Second function : **torus**
+"""""""""""""""""""""""""""
The user should provide the number of points to be generated on the torus :code:`n_samples` and the dimension :code:`dim` of the torus on which points would be generated in :math:`R^{2dim}`.
The :code:`sample` argument is optional and is set to **'random'** by default.