Skip to content

Commit

Permalink
Demonstrate fix for bug works
Browse files Browse the repository at this point in the history
  • Loading branch information
willGraham01 committed Jul 17, 2023
1 parent 8942de3 commit 8faaf61
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions cellfinder/extract/extract_cubes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@

import logging
import os
from collections import deque
from collections import defaultdict, deque

Check warning on line 11 in cellfinder/extract/extract_cubes.py

View check run for this annotation

Codecov / codecov/patch

cellfinder/extract/extract_cubes.py#L11

Added line #L11 was not covered by tests
from concurrent.futures import ProcessPoolExecutor
from datetime import datetime
from math import floor

import numpy as np
from brainglobe_utils.cells.cells import group_cells_by_z

# from brainglobe_utils.cells.cells import group_cells_by_z
from brainglobe_utils.general.numerical import is_even
from brainglobe_utils.general.system import get_num_processes
from numpy.linalg.linalg import LinAlgError
Expand All @@ -26,6 +27,21 @@
from cellfinder.tools import system


def group_cells_by_z(cells):

Check warning on line 30 in cellfinder/extract/extract_cubes.py

View check run for this annotation

Codecov / codecov/patch

cellfinder/extract/extract_cubes.py#L30

Added line #L30 was not covered by tests
"""
For a list of Cells return a dict of lists of cells, grouped by plane.
:param list cells: list of cells from cellfinder.cells.cells.Cell
:return: default
dict, with each key being a plane (e.g. 1280) and each entry being a list
of Cells
"""
cells_groups = defaultdict(list)
for cell in cells:
cells_groups[cell.z].append(cell)
return cells_groups # NOTE: no cast to dict

Check warning on line 42 in cellfinder/extract/extract_cubes.py

View check run for this annotation

Codecov / codecov/patch

cellfinder/extract/extract_cubes.py#L39-L42

Added lines #L39 - L42 were not covered by tests


class StackSizeError(Exception):
pass

Expand Down

0 comments on commit 8faaf61

Please sign in to comment.