summaryrefslogtreecommitdiff
path: root/src/cython/doc
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-08-17 16:10:46 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-08-17 16:10:46 +0000
commit2fc118133e76f05fc55d86cf32883223191fe473 (patch)
tree5570161d7082dffde9c96a02060330edf1be32b9 /src/cython/doc
parent5d8fad1814c3ec5f1d73e316853aba301070299f (diff)
Add file formats for Python.
Binding for persistence write files Launch py.test with the command "python -m pytest" (shall work everywhere) git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/persistence_diagram_improvement@2611 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 9443a7eb5b580ece7708ff57949ad08339c1c5c3
Diffstat (limited to 'src/cython/doc')
-rw-r--r--src/cython/doc/_templates/layout.html1
-rw-r--r--src/cython/doc/fileformats.rst30
-rw-r--r--src/cython/doc/reader_utils_ref.rst11
3 files changed, 42 insertions, 0 deletions
diff --git a/src/cython/doc/_templates/layout.html b/src/cython/doc/_templates/layout.html
index b11c1236..243f33c6 100644
--- a/src/cython/doc/_templates/layout.html
+++ b/src/cython/doc/_templates/layout.html
@@ -65,6 +65,7 @@
{#- old style sidebars: using blocks -- should be deprecated #}
{%- block sidebartoc %}
<h2><a href="index.html">GUDHI</a></h2>
+<h2><a href="fileformats.html">File formats</a></h2>
<h2><a href="installation.html">GUDHI installation</a></h2>
<h2><a href="citation.html">Acknowledging the GUDHI library</a></h2>
<h2><a href="genindex.html">Index</a></h2>
diff --git a/src/cython/doc/fileformats.rst b/src/cython/doc/fileformats.rst
new file mode 100644
index 00000000..36225b6d
--- /dev/null
+++ b/src/cython/doc/fileformats.rst
@@ -0,0 +1,30 @@
+File formats
+############
+
+To find the correct function to read the files, please refer to :doc:`reader_utils_ref`
+
+Persistence Diagram
+*******************
+
+Such a file, whose extension is usually ``.pers``, contains a list of persistence intervals.
+
+Lines starting with ``#`` are ignored (comments).
+
+Other lines might contain 2, 3 or 4 values (the number of values on each line must be the same for all lines)::
+
+ [[field] dimension] birth death
+
+Here is a simple sample file::
+
+ # Persistence diagram example
+ 2 2.7 3.7
+ 2 9.6 14.
+ # Some comments
+ 3 34.2 34.974
+ 4 3. inf
+
+Other sample files can be found in the data/persistence_diagram folder.
+
+Such files can be generated with :meth:`gudhi.SimplexTree.write_persistence_diagram` and read with
+:meth:`gudhi.read_persistence_intervals_grouped_by_dimension`, or
+:meth:`gudhi.read_persistence_intervals_in_dimension`.
diff --git a/src/cython/doc/reader_utils_ref.rst b/src/cython/doc/reader_utils_ref.rst
new file mode 100644
index 00000000..9c1ea6fc
--- /dev/null
+++ b/src/cython/doc/reader_utils_ref.rst
@@ -0,0 +1,11 @@
+=============================
+Reader utils reference manual
+=============================
+
+.. autofunction:: gudhi.read_off
+
+.. autofunction:: gudhi.read_lower_triangular_matrix_from_csv_file
+
+.. autofunction:: gudhi.read_persistence_intervals_grouped_by_dimension
+
+.. autofunction:: gudhi.read_persistence_intervals_in_dimension