Error when computing the incidence matrix of rank 2 on SHREC dataset
abdelwahed opened this issue · 3 comments
abdelwahed commented
I tried to call the SimplicialComplex.incidence_matrix
(rank 2) on the shrec dataset using the code below
import toponetx.datasets as datasets
shrec, _ = datasets.mesh.shrec_16(size="small")
simplexes = shrec["complexes"]
print(simplexes[0].incidence_matrix(rank=2))
I get the following error (KeyError)
File "/snap/pycharm-professional/336/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/kha053/PycharmProjects/TopoNetX/tutorials/test.py", line 19, in <module>
print(simplexes[0].incidence_matrix(rank=2))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kha053/PycharmProjects/TopoNetX/toponetx/classes/simplicial_complex.py", line 783, in incidence_matrix
idx_faces.append(simplex_dict_d_minus_1[tuple(face)])
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: (89, 81)
Similar errors are shown for SimplicialComplex.up_laplacian_matrix
and SimplicialComplex.down_laplacian_matrix
.
mhajij commented
@abdelwahed this has been addressed now. Please pull the new version.
abdelwahed commented
Thanks @mhajij