Commit c331a90
authored
Wraps output of condensed_tree's minimum in a list
This only happens when a single cluster is returned, and when using the `"leaf"` argument for the clustering.
The result of `condensed_tree['parent'].min()` is an integer, but the output of the `_get_leaves` function should be a list, otherwise a `TypeError` is raised.
For instance in `predictions.py`, with `list(selected_cluster)`:
```
selected_clusters = condensed_tree._select_clusters()
self.cluster_map = {c: n for n, c in enumerate(sorted(list(selected_clusters)))}
```
and `_select_clusters()` is a method of `CondensedTree` defined in `plots.py`, which calls `_get_leaves`
```
def _select_clusters(self):
[ ... ]
elif self.cluster_selection_method == 'leaf':
return _get_leaves(self._raw_tree)
```1 parent 2ed7f74 commit c331a90
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
0 commit comments