Skip to content

Commit

Permalink
Default group counting works
Browse files Browse the repository at this point in the history
  • Loading branch information
KrissiHub committed Mar 7, 2024
1 parent 848c33f commit 22e683c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions deepcave/layouts/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,19 +300,19 @@ def callback(group_names, all_run_paths, i): # type: ignore
if group_name is None or group_name == "":
# Set the default group name with a counter,
# so the groups dont overwrite themselves
group_name = f"Group {globals().get('group_counter')}"

group_counter = globals().get("group_counter")
group_counter += 1
group_name_unavailable = True

while group_name_unavailable:
group_name = f"Group {group_counter}"
if group_name not in c.get("groups").keys():
group_name_unavailable = False
else:
group_counter += 1

globals()["group_counter"] = group_counter

if run_paths is None or len(run_paths) == 0:
# If the path is none, the group counter should not go up
# since there will be no new group
group_counter = globals().get("group_counter")
group_counter -= 1
globals()["group_counter"] = group_counter

continue

valid_run_paths = []
Expand Down

0 comments on commit 22e683c

Please sign in to comment.