brainglobe / cellfinder

Automated 3D cell detection in very large images

Home Page:https://brainglobe.info/documentation/cellfinder/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Tests fail on py3.8

willGraham01 opened this issue · comments

Describe the bug
CI checks against Python 3.8 fail;

This implies that the changes in #231 really do introduce a this bug somehow.

See debug branch for (hack-style) changes that demonstrate fixes.

To Reproduce
Running tox -e py38-coredev in a developer environment will produce the error on CI

Expected behaviour
There shouldn't be an error arising from a difference between the reference and produced outputs.

Log file

Screenshots

Computer used (please complete the following information):

  • OS: ubuntu
  • Version: 22.04

Error is due to subtle difference in group_cells_by_z function between the imlib and brainglobe-utils packages. The utils version casts the would-be returned defaultdict to a regular dict, which breaks the test.

This can be confirmed by "hacking" the imlib version to do the same thing:
extract_cubes.py

from imlib.cells.cells import group_cells_by_z as group_cells_by_z_original
def group_cells_by_z(cells):
    return dict(group_cells_by_z_original(cells))

causes the test to fail with the same error as using

from brainglobe_utils.cells.cells import group_cells_by_z

This will be closed by brainglobe/brainglobe-utils#2.

Note to self to trigger a re-run of the workflows on this repo and cellfinder-core.