Skip to content

Commit

Permalink
(fix) handle empty case in get_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavnatarajan committed Sep 20, 2024
1 parent fc13c2e commit bcc2167
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"

[project]
name = "chalc"
version = "6.0.0"
version = "6.0.1"
authors = [{ name = "Abhinav Natarajan", email = "[email protected]" }]
description = "Persistent homology of chromatic Delaunay filtrations"
readme = { file = "README.md", content-type = "text/markdown" }
Expand Down
6 changes: 5 additions & 1 deletion src/chalc/sixpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,11 @@ def get_matrix(self, diagram_name, dim=None):
simplices.add(d)
for s in dgm._unpaired:
simplices.add(s)
dim = list(range(max(np.array(self._dimensions)[list(simplices)])))
relevant_dims = np.array(self._dimensions)[list(simplices)]
if not relevant_dims:
# there are no features in the diagram
return []
dim = list(range(max(relevant_dims)))
if isinstance(dim, int):
# a p-dimensional homology class is captured by a pairing of (p+1) simplices for kernels
if diagram_name == "ker":
Expand Down

0 comments on commit bcc2167

Please sign in to comment.