Skip to content

Commit

Permalink
Merge pull request #106 from lilab-bcb/bug-fix
Browse files Browse the repository at this point in the history
Don't raise exception if only one count matrix exists
  • Loading branch information
yihming committed Jul 13, 2023
2 parents c20a20d + 7865bef commit 799a461
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pegasusio/unimodal_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,11 @@ def __init__(
if len(self.matrices) == 0:
self._cur_matrix = ""
else:
if cur_matrix == None:
if cur_matrix == None or len(list(self.matrices.keys())) == 1:
cur_matrix = list(self.matrices.keys())[0]
elif cur_matrix not in self.matrices.keys():
raise ValueError("Cannot find the default count matrix to bind to. Please set 'cur_matrix' argument in UnimodalData constructor!")

self._cur_matrix = cur_matrix # cur_matrix

# For backword compatibility, check metadata and move arrays and graphs to multiarrays/multigraphs
Expand Down

0 comments on commit 799a461

Please sign in to comment.