Skip to content

Commit

Permalink
group_it check for summary collectors
Browse files Browse the repository at this point in the history
  • Loading branch information
jepegit committed Jan 26, 2025
1 parent 9de034a commit 1849017
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cellpy/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -888,10 +888,20 @@ def concat_summaries(
if only_selected and "selected" in pages.columns:
pages = pages.loc[pages.selected == 1, :].copy()

if group_it:
g = pages.groupby("group")
for gno, b_sub in g:
if len(b_sub) < 2:
print("Can not group with less than two cells")
print("Setting group_it to False")
group_it = False
break

if group_it:
g = pages.groupby("group")
# this ensures that order is kept and grouping is correct
# it is therefore ok to assume from now on that all the cells within a list belongs to the same group

for gno, b_sub in g:
cell_names_nest.append(list(b_sub.index))
group_nest.append(gno)
Expand Down

0 comments on commit 1849017

Please sign in to comment.