From 2e08d6bf56f4c28e1fa583fe4f0f3d539b8dfec3 Mon Sep 17 00:00:00 2001 From: Bryn Keller Date: Fri, 11 Mar 2016 11:50:04 -0800 Subject: Fixed sample complex diagram formatting in readme and doc string --- python/README.rst | 2 +- python/phat.py | 16 +++++++++++----- 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. """ -- cgit v1.2.3