summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryn Keller <xoltar@xoltar.org>2016-03-11 11:50:04 -0800
committerBryn Keller <xoltar@xoltar.org>2016-03-11 11:50:04 -0800
commit2e08d6bf56f4c28e1fa583fe4f0f3d539b8dfec3 (patch)
treee3cf4e334e529f670b89416430b8af24b4c05e49
parent833c52094f6a90228901fd9278d1cd68bd3f7bdc (diff)
Fixed sample complex diagram formatting in readme and doc string
-rw-r--r--python/README.rst2
-rw-r--r--python/phat.py16
2 files changed, 12 insertions, 6 deletions
diff --git a/python/README.rst b/python/README.rst
index ab4142c..8495e5f 100644
--- a/python/README.rst
+++ b/python/README.rst
@@ -43,7 +43,7 @@ the algorithm. We provide the following choices of representation classes:
Sample usage
------------
-We will build an ordered boundary matrix of this simplicial complex consisting of a single triangle:
+We will build an ordered boundary matrix of this simplicial complex consisting of a single triangle::
3
|\\
diff --git a/python/phat.py b/python/phat.py
index 6537b26..ab8a7bc 100644
--- a/python/phat.py
+++ b/python/phat.py
@@ -6,7 +6,7 @@ algorithms and column data representations.
Here is a simple example of usage.
-We will build an ordered boundary matrix of this simplicial complex consisting of a single triangle:
+We will build an ordered boundary matrix of this simplicial complex consisting of a single triangle::
3
|\\
@@ -36,11 +36,15 @@ Now the code::
(1, [0,3]),
(2, [2,4,5])]
- # or equivalently, boundary_matrix = phat.boundary_matrix(representation = ..., columns = ...)
- # would combine the creation of the matrix and the assignment of the columns
+ # or equivalently,
+ # boundary_matrix = phat.boundary_matrix(representation = ...,
+ # columns = ...)
+ # would combine the creation of the matrix and
+ # the assignment of the columns
# print some information of the boundary matrix:
- print("\nThe boundary matrix has %d columns:" % len(boundary_matrix.columns))
+ print()
+ print("The boundary matrix has %d columns:" % len(boundary_matrix.columns))
for col in boundary_matrix.columns:
s = "Column %d represents a cell of dimension %d." % (col.index, col.dimension)
if (col.boundary):
@@ -52,10 +56,12 @@ Now the code::
pairs.sort()
- print("\nThere are %d persistence pairs: " % len(pairs))
+ print()
+ print("There are %d persistence pairs: " % len(pairs))
for pair in pairs:
print("Birth: %d, Death: %d" % pair)
+
Please see https://bitbucket.org/phat-code/phat/python for more information.
"""