I wanted to run the sample triangle code and after a bit of troubleshooting, I realized that the ZigzagPersistence class does not have any of its internal functions visible, crucially the add() function. See the code below:
`
from dionysus import Simplex, ZigzagPersistence, Zp
complex = {Simplex((0,), 0): None, # A
Simplex((1,), 1): None, # B
Simplex((2,), 2): None, # C
Simplex((0,1), 2.5): None, # AB
Simplex((1,2), 2.9): None, # BC
Simplex((0,2), 3.5): None, # CA
Simplex((0,1,2), 5): None} # ABC
print ("Complex:")
for s in sorted(complex.keys()):
print(s)
prime_field = Zp(2)
zz = ZigzagPersistence(prime_field)
b = 1
for s in sorted(complex.keys()):
print("%d: Adding %s" % (b, s))
i,d = zz.add([complex[ss] for ss in s.boundary], b)
complex[s] = i
if d:
print("Interval (%d, %d)" % (d, b-1))
b += 1
`
Here I get the error:
`
AttributeError Traceback (most recent call last)
Cell In[5], line 97 for s in sorted(complex.keys()):
8 print("%d: Adding %s" % (b, s))
----> 9 i,d = zz.add([complex[ss] for ss in s.boundary], b)
10 complex[s] = i
11 if d:
AttributeError: 'dionysus._dionysus.ZigzagPersistence' object has no attribute 'add'
`
Additionally, when I call help() on the class, I see no visible functions other than the hidden ones:
Greetings,
I wanted to run the sample triangle code and after a bit of troubleshooting, I realized that the ZigzagPersistence class does not have any of its internal functions visible, crucially the add() function. See the code below:
` from dionysus import Simplex, ZigzagPersistence, Zp complex = {Simplex((0,), 0): None, # A Simplex((1,), 1): None, # B Simplex((2,), 2): None, # C Simplex((0,1), 2.5): None, # AB Simplex((1,2), 2.9): None, # BC Simplex((0,2), 3.5): None, # CA Simplex((0,1,2), 5): None} # ABC
print ("Complex:") for s in sorted(complex.keys()): print(s) prime_field = Zp(2) zz = ZigzagPersistence(prime_field) b = 1 for s in sorted(complex.keys()): print("%d: Adding %s" % (b, s)) i,d = zz.add([complex[ss] for ss in s.boundary], b) complex[s] = i if d:
print("Interval (%d, %d)" % (d, b-1)) b += 1 `
Here I get the error:
` AttributeError Traceback (most recent call last) Cell In[5], line 9 7 for s in sorted(complex.keys()): 8 print("%d: Adding %s" % (b, s)) ----> 9 i,d = zz.add([complex[ss] for ss in s.boundary], b) 10 complex[s] = i 11 if d:
AttributeError: 'dionysus._dionysus.ZigzagPersistence' object has no attribute 'add' `
Additionally, when I call help() on the class, I see no visible functions other than the hidden ones:![image](https://github.com/mrzv/dionysus/assets/50664758/55d1dfcd-6aa4-4658-86e4-f748b6766d0d)
Any help would be much appreciated.
-Marco