pyt-team / TopoNetX

Computing on Topological Domains
https://pyt-team.github.io/toponetx/
MIT License
175 stars 32 forks source link

Error when computing the incidence matrix of rank 2 on SHREC dataset #167

Closed abdelwahed closed 1 year ago

abdelwahed commented 1 year ago

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.

ffl096 commented 1 year ago

I think this is a duplicate of #154 and should be fixed when #155 is merged.

mhajij commented 1 year ago

@abdelwahed this has been addressed now. Please pull the new version.

abdelwahed commented 1 year ago

Thanks @mhajij