Skip to content

Commit 1010216

Browse files
authored
Merge pull request #80 from MunchLab/ReebOfSimplexTree
Updating function names - `reeb_of_lower_star` is now `computeReeb` - `LowerStarSC` is now `LowerStar` - `Torus.plot()` is now `Torus.draw()`
2 parents a22cfca + ffcee55 commit 1010216

File tree

17 files changed

+228
-229
lines changed

17 files changed

+228
-229
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The code is a compilation of work done by [Elizabeth Munch](http://www.elizabeth
3636

3737
- [Danielle Barnes](https://github.com/barnesd8)
3838
- [Elena Wang](https://elenaxwang.com)
39-
- [Ishika Ghsoh](https://www.ishikaghosh.com/)
39+
- [Ishika Ghosh](https://www.ishikaghosh.com/)
4040

4141
## Contact Information
4242

cereeberus/cereeberus/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__all__ = [
2-
'ReebGraph', 'LowerStarSC', 'reeb_of_lower_star',
2+
'ReebGraph', 'LowerStar', 'computeReeb',
33
'MergeTree', 'MapperGraph', 'EmbeddedGraph', 'Interleave', 'Assignment',
44
'data', 'dist', 'reeb', 'compute'
55
]
@@ -9,8 +9,8 @@
99
from .reeb.mapper import MapperGraph
1010
from .reeb.embeddedgraph import EmbeddedGraph
1111
from .distance.interleave import Interleave, Assignment
12-
from .reeb.lowerstarSC import LowerStarSC
13-
from .compute.reeb_of_lower_star import reeb_of_lower_star
12+
from .reeb.lowerstar import LowerStar
13+
from .compute.computereeb import computeReeb
1414

1515
# Examples
1616
from .data import ex_reebgraphs, ex_mergetrees, ex_mappergraphs, ex_embedgraphs, ex_torus
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__all__ = ['draw', 'unionfind', 'distance', 'reeb_of_lower_star']
1+
__all__ = ['draw', 'unionfind', 'computeReeb']
22
from .draw import *
33
from .unionfind import *
4-
from .reeb_of_lower_star import *
4+
from .computereeb import *

cereeberus/cereeberus/compute/reeb_of_lower_star.py renamed to cereeberus/cereeberus/compute/computereeb.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .unionfind import UnionFind
2-
from ..reeb.lowerstarSC import LowerStarSC
2+
from ..reeb.lowerstar import LowerStar
33
import numpy as np
44

55

@@ -19,7 +19,7 @@ def is_face(sigma, tau):
1919

2020
def get_levelset_components(L):
2121
'''
22-
Given a list of simplices L representing a level set, compute the connected components. This function is really only helpful inside of reeb_of_lower_star.
22+
Given a list of simplices L representing a level set, compute the connected components. This function is really only helpful inside of computeReeb.
2323
2424
Args:
2525
L: A list of simplices (each simplex is a list of vertices).
@@ -46,27 +46,27 @@ def get_levelset_components(L):
4646
return components
4747

4848

49-
def reeb_of_lower_star(K: LowerStarSC, verbose = False):
49+
def computeReeb(K: LowerStar, verbose = False):
5050
"""Computes the Reeb graph of a Lower Star Simplicial Complex K.
5151
5252
Args:
53-
K (LowerStarSC): A Lower Star Simplicial Complex with assigned filtration values.
53+
K (LowerStar): A Lower Star Simplicial Complex with assigned filtration values.
5454
verbose (boolean): Make it True if you want lots of printouts.
5555
5656
Returns:
5757
ReebGraph: The computed Reeb graph.
5858
5959
Example:
60-
>>> from cereeberus.reeb.lowerstarSC import LowerStarSC
61-
>>> K = LowerStarSC()
60+
>>> from cereeberus.reeb.LowerStar import LowerStar
61+
>>> K = LowerStar()
6262
>>> K.insert([0, 1, 2])
6363
>>> K.insert([1, 3])
6464
>>> K.insert([2,3])
6565
>>> K.assign_filtration([0], 0.0)
6666
>>> K.assign_filtration([1], 3.0)
6767
>>> K.assign_filtration([2], 5.0)
6868
>>> K.assign_filtration([3], 7)
69-
>>> R = reeb_of_lower_star(K)
69+
>>> R = computeReeb(K)
7070
>>> R.draw()
7171
"""
7272
from ..reeb.reebgraph import ReebGraph

cereeberus/cereeberus/data/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
from .ex_reebgraphs import *
55
from .ex_mergetrees import *
6-
from . import ex_mappergraphs
7-
from . import ex_embedgraphs
8-
from . import ex_torus
6+
from .ex_mappergraphs import *
7+
from .ex_embedgraphs import *
8+
from .ex_torus import *

cereeberus/cereeberus/data/ex_torus.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
from ..reeb.lowerstarSC import LowerStarSC
1+
from ..reeb.lowerstar import LowerStar
22
import matplotlib.pyplot as plt
33
import numpy as np
44

5-
class Torus(LowerStarSC):
5+
class Torus(LowerStar):
66
"""
7-
Class to create an example torus using the LowerStarSC.
7+
Class to create an example torus using the LowerStar.
88
99
Inherits from:
10-
LowerStarSC: A lower star simplicial complex.
10+
LowerStar: A lower star simplicial complex.
1111
1212
Methods:
1313
__init__(): Initializes the torus by inserting simplices.
@@ -101,7 +101,7 @@ def assign_filtration(self, vertex, value):
101101

102102
super().assign_filtration(vertex, value)
103103

104-
def plot(self, ax = None, cmap = plt.cm.viridis, **kwargs):
104+
def draw(self, ax = None, cmap = plt.cm.viridis, **kwargs):
105105
"""Gives a flat plot of the torus's 1-skeleton using matplotlib.
106106
107107
Args:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
__all__ = ['reebgraph', 'merge', 'mapper', 'embeddedgraph', 'lowerstarSC']
1+
__all__ = ['reebgraph', 'merge', 'mapper', 'embeddedgraph', 'lowerstar']
22

33
from .reebgraph import *
44
from .merge import *
55
from .mapper import *
66
from .embeddedgraph import *
7-
from .lowerstarSC import *
7+
from .lowerstar import *
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# An example torus built using gudhi's Simplex Tree
1+
# An example lower star filtration built using gudhi's Simplex Tree
22

33
from gudhi import SimplexTree
44
import numpy as np
55

6-
class LowerStarSC(SimplexTree):
6+
class LowerStar(SimplexTree):
77
"""
8-
Class to create a simplicial compex that has a lower star filtration, based on Gudhi's SimplexTree.
8+
Class to create a simplicial complex that has a lower star filtration, based on Gudhi's SimplexTree.
99
1010
Inherits from:
1111
SimplexTree: A simplex tree structure from the Gudhi library.
@@ -32,7 +32,7 @@ def assign_filtration(self, vertex, value):
3232
if isinstance(vertex, int):
3333
vertex = [vertex]
3434
elif len(vertex) != 1:
35-
raise ValueError("vertex must be an integer, or a single-element list.")
35+
raise ValueError("Lower star filtration can only by updated by specificying the function value on a vertex. Input -vertex- must be an integer, or a single-element list.")
3636

3737
super().assign_filtration(vertex, value)
3838

@@ -87,7 +87,7 @@ def iter_vertices(self):
8787

8888

8989
if __name__ == "__main__":
90-
LS = LowerStarSC()
90+
LS = LowerStar()
9191
LS.insert([0, 1, 2])
9292
LS.insert([1, 3])
9393
LS.insert([2,3])
199 KB
Loading
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Compute Reeb Graph from Lower Star Filtration
22
**********************************************
33

4-
The ``reeb_of_lower_star`` module provides functionality to compute the Reeb graph from a lower star filtration. Information on the lower star filtration can be found in the `Lower Star Filtration for Simplicial Complexes <../reeb/lowerstarSC.rst>`_ documentation.
4+
The ``computeReeb`` module provides functionality to compute the Reeb graph from a lower star filtration. Information on the lower star filtration can be found in the `Lower Star Filtration for Simplicial Complexes <../reeb/lowerstar.rst>`_ documentation.
55

6-
.. autofunction:: cereeberus.compute.reeb_of_lower_star.reeb_of_lower_star
6+
.. autofunction:: cereeberus.compute.computereeb.computeReeb

0 commit comments

Comments
 (0)