summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHind-M <hind.montassif@gmail.com>2021-11-09 16:08:10 +0100
committerHind-M <hind.montassif@gmail.com>2021-11-09 16:08:10 +0100
commitfe75d33d715d038e348b7e48512b14c7488ee4f4 (patch)
treee4609c839f4ad17f083c4a48370b74297735d64a /src
parentcfb60a50a7c3aea08abc41118fbfdf31061a44a4 (diff)
Remove sphinx warnings for torus
Diffstat (limited to 'src')
-rw-r--r--src/python/doc/datasets_generators.rst2
-rw-r--r--src/python/gudhi/datasets/generators/_points.cc13
-rw-r--r--src/python/gudhi/datasets/generators/points.py5
3 files changed, 5 insertions, 15 deletions
diff --git a/src/python/doc/datasets_generators.rst b/src/python/doc/datasets_generators.rst
index 6f36bce1..260c3882 100644
--- a/src/python/doc/datasets_generators.rst
+++ b/src/python/doc/datasets_generators.rst
@@ -42,7 +42,7 @@ Example
.. autofunction:: gudhi.datasets.generators.points.sphere
Points on a flat torus
-^^^^^^^^^^^^^^^^
+^^^^^^^^^^^^^^^^^^^^^^
You can also generate points on a torus.
diff --git a/src/python/gudhi/datasets/generators/_points.cc b/src/python/gudhi/datasets/generators/_points.cc
index 70ce4925..6baed673 100644
--- a/src/python/gudhi/datasets/generators/_points.cc
+++ b/src/python/gudhi/datasets/generators/_points.cc
@@ -85,9 +85,7 @@ PYBIND11_MODULE(_points, m) {
m.def("sphere", &generate_points_on_sphere,
py::arg("n_samples"), py::arg("ambient_dim"),
py::arg("radius") = 1., py::arg("sample") = "random",
- R"pbdoc(
- Generate random i.i.d. points uniformly on a (d-1)-sphere in R^d
-
+ R"pbdoc( Generate random i.i.d. points uniformly on a (d-1)-sphere in R^d
:param n_samples: The number of points to be generated.
:type n_samples: integer
:param ambient_dim: The ambient dimension d.
@@ -102,19 +100,14 @@ PYBIND11_MODULE(_points, m) {
m.def("ctorus", &generate_points_on_torus,
py::arg("n_samples"), py::arg("dim"), py::arg("sample") = "random",
- R"pbdoc(
- Generate random i.i.d. points on a d-torus in R^2d or as a grid
-
+ R"pbdoc( Generate random i.i.d. points on a d-torus in R^2d or as a grid
:param n_samples: The number of points to be generated.
:type n_samples: integer
:param dim: The dimension of the torus on which points would be generated in R^2*dim.
:type dim: integer
:param sample: The sample type. Available values are: `"random"` and `"grid"`. Default value is `"random"`.
:type sample: string
- :rtype: numpy array of float.
- The shape of returned numpy array is :
- if sample is 'random' : (n_samples, 2*dim).
- if sample is 'grid' : (⌊n_samples**(1./dim)⌋**dim, 2*dim), where shape[0] is rounded down to the closest perfect 'dim'th power.
+ :rtype: numpy array of float. The shape of returned numpy array is: If sample is 'random': (n_samples, 2*dim). If sample is 'grid': (⌊n_samples**(1./dim)⌋**dim, 2*dim), where shape[0] is rounded down to the closest perfect 'dim'th power.
:returns: the generated points on a torus.
)pbdoc");
}
diff --git a/src/python/gudhi/datasets/generators/points.py b/src/python/gudhi/datasets/generators/points.py
index cf97777d..481f3f71 100644
--- a/src/python/gudhi/datasets/generators/points.py
+++ b/src/python/gudhi/datasets/generators/points.py
@@ -41,10 +41,7 @@ def torus(n_samples, dim, sample='random'):
:param n_samples: The number of points to be generated.
:param dim: The dimension of the torus on which points would be generated in R^2*dim.
:param sample: The sample type of the generated points. Can be 'random' or 'grid'.
- :returns: numpy array containing the generated points on a torus.
- The shape of returned numpy array is:
- if sample is 'random' : (n_samples, 2*dim).
- if sample is 'grid' : (⌊n_samples**(1./dim)⌋**dim, 2*dim), where shape[0] is rounded down to the closest perfect 'dim'th power.
+ :returns: numpy array containing the generated points on a torus. The shape of returned numpy array is: If sample is 'random': (n_samples, 2*dim). If sample is 'grid': (⌊n_samples**(1./dim)⌋**dim, 2*dim), where shape[0] is rounded down to the closest perfect 'dim'th power.
"""
if sample == 'random':
# Generate points randomly