-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Hi,
First of all, thanks for the great software and for making this open source.
I'm writing here because I'm having some trouble with the Python wrapper, and I wanted to see if you could replicate the issue or tell me if I'm doing something wrong. I'm finding that the python wrapper seems to stall and go into an infinite loop for most of the boundary matrices that I feed it, while the C++ code runs fine on those same boundary matrices. I'm attaching an example boundary matrix where this happens, in the file "crashfiltration.txt." This boundary matrix is not large; there are only 9 vertices and 129 simplices total
crashfiltration.txt
When I run the following command with the phat binary
./phat --ascii crashfiltration.txt out.txt
It gives me an answer very quickly. When, on the other hand, I try to wrap it into python with the following code
import phat
fin = open("crashfiltration.txt")
columns = []
for line in fin.readlines():
fields = [int(s) for s in line.split()]
columns.append((fields[0], fields[1::]))
fin.close()
print(columns)
boundary_matrix = phat.boundary_matrix(columns = columns)
pairs = boundary_matrix.compute_persistence_pairs()
pairs.sort()
The code seems to hang. Any idea what's going on?
Many thanks,
Chris Tralie