Skip to content

Can't describe the node as tuple #444

@SnapeLiu

Description

@SnapeLiu

When the node is described as a tuple such as (0,1) which located on a 2D-grid, rather than described as an int such as (0,) (1,), we can't get the incidence matrix or Hodge Laplacians because of this error below, is there any solution to this problem?

Traceback (most recent call last):
  File "D:\anaconda3\envs\topox\Lib\site-packages\IPython\core\interactiveshell.py", line 3577, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-8-93f298c2e4be>", line 1, in <module>
    sc.hodge_laplacian_matrix(1)
  File "D:\anaconda3\envs\topox\Lib\site-packages\toponetx\classes\simplicial_complex.py", line 951, in hodge_laplacian_matrix
    row, column, B = self.incidence_matrix(rank, weight=weight, index=True)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\anaconda3\envs\topox\Lib\site-packages\toponetx\classes\simplicial_complex.py", line 838, in incidence_matrix
    face = frozenset(simplex).difference({left_out})
                                         ^^^^^^^^^^
TypeError: unhashable type: 'numpy.ndarray'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions