Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge cellfinder-core and cellfinder-napari into this package #262

Closed
wants to merge 680 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
680 commits
Select commit Hold shift + click to select a range
da1dd7e
fix linting
alessandrofelder Mar 10, 2023
df1ea3b
Merge pull request #93 from brainglobe/remove-pkg_resources
dstansby Mar 10, 2023
680ec0b
Fixture for programmatic creation of synthetic data (#94)
alessandrofelder Mar 13, 2023
c1e62ea
Merge pull request #152 from brainglobe/update-yaml-filter
alessandrofelder Mar 13, 2023
f5d90c2
Basic working structure detection test
dstansby Mar 13, 2023
a17cd38
Add parametrization to detection test
dstansby Mar 13, 2023
5c7739d
Add a two pixel structure test
dstansby Mar 13, 2023
e379aed
Add some more connected test cases
dstansby Mar 13, 2023
0e0d320
Move structure detection tests to existing file
dstansby Mar 13, 2023
36ceaf9
Fix signal array typing
dstansby Mar 13, 2023
b1b2f7d
Build wheels on macOS arm (#76)
dstansby Mar 13, 2023
1e5f295
Add a test for structure grouping
dstansby Mar 13, 2023
d66f030
Use pyproject (#151)
dstansby Mar 14, 2023
ff1530b
Add two more test cases
dstansby Mar 14, 2023
93e4b0d
Merge pull request #97 from dstansby/connected-component-test
alessandrofelder Mar 14, 2023
c6b0493
Merge pull request #78 from dstansby/filter-setup-typing
dstansby Mar 17, 2023
212dced
Test structure detection with different dtypes (#99)
dstansby Mar 20, 2023
d60fc02
Allow cellfinder tests to run on branches (#101)
dstansby Mar 22, 2023
2a487dd
Pin tensorflow to < 2.12.0
dstansby Mar 24, 2023
23e1353
Merge pull request #104 from dstansby/tensorflow-pin
alessandrofelder Mar 24, 2023
0e2dfbd
add a 2d filter benchmarking script
alessandrofelder Mar 10, 2023
8add55d
remove cython 2d filter extension
alessandrofelder Mar 10, 2023
a0417e1
move to a numba 2d filter
alessandrofelder Mar 10, 2023
83e75cf
fix linting
alessandrofelder Mar 10, 2023
036c2e3
random*65535 -> randint
alessandrofelder Mar 14, 2023
d6a8bbd
add pyinstrument as dev dependency
alessandrofelder Mar 14, 2023
3df702c
spread too long line over several
alessandrofelder Mar 14, 2023
9af4bc3
Isolate code that runs the 3D filter
dstansby Mar 1, 2023
5a50970
Add 3D filter benchmark
dstansby Mar 1, 2023
9bcc9e8
Add pure Python structure detection
dstansby Mar 1, 2023
f7b2e3e
Add pure Python ball filter
dstansby Mar 1, 2023
98f9acf
Reduce number of repeats of 3D filter benchmark
dstansby Mar 1, 2023
1d14a3c
Use numba for ball filter
dstansby Mar 1, 2023
76b1c33
Fix volume detection tests
dstansby Mar 1, 2023
6e6ec74
Optimise cube overlap loop
dstansby Mar 1, 2023
521b63e
Factor out _is_tile_to_check
dstansby Mar 1, 2023
8b703b5
jit walk
dstansby Mar 1, 2023
ee8edcd
Factor out is_new_structure
dstansby Mar 1, 2023
786155e
Minimise amount of data generated
dstansby Mar 10, 2023
e3068c6
Clean up random number generation
dstansby Mar 10, 2023
75d0a83
Comment on extra runs
dstansby Mar 10, 2023
f4d763e
Remove volume filter cython extensions
dstansby Mar 13, 2023
4e8a9db
Make pre-commit happy
dstansby Mar 17, 2023
75a746b
Fix structure detection tests
dstansby Mar 17, 2023
e97cb05
Fix uint8 bug
dstansby Mar 24, 2023
05cd5ae
Run tests on all pull requests
dstansby Mar 27, 2023
248b1ae
Simplify implemention of is_low_average
dstansby Mar 20, 2023
f1188df
Turn off codecov commenting (#107)
dstansby Mar 29, 2023
5049536
Fix comment location
dstansby Mar 29, 2023
03b4ed4
Update benchmarks/filter_3d.py
dstansby Mar 29, 2023
5a841e2
Merge pull request #90 from dstansby/benchmark-3d
dstansby Mar 29, 2023
8c95245
Clean up structure manager class
dstansby Mar 13, 2023
b67a851
Use a numba dict for obsolete ids
dstansby Mar 13, 2023
a249927
Use a numba dict for coords_maps
dstansby Mar 13, 2023
356b8a3
Clean up get_non_zero_ull_min
dstansby Mar 17, 2023
a2d53f4
jit is_new_structure
dstansby Mar 17, 2023
572dfab
Change pytest log level to warning
dstansby Mar 20, 2023
09dec18
Remove error message customisation
dstansby Mar 20, 2023
4711895
Use array for neighbour_ids
dstansby Mar 20, 2023
4f03171
Ignore numba type safety warnings
dstansby Mar 20, 2023
007958b
Fix structure detection unit test
dstansby Mar 20, 2023
8597b2a
Merge structure manager into cell detector
dstansby Mar 20, 2023
bdd6627
Simplify layer processing code
dstansby Mar 20, 2023
590ec80
Add link to type safety warning ignore
dstansby Mar 20, 2023
66a4ac0
Working detection :partyparrot:
dstansby Mar 20, 2023
ab623cb
Fix typing for python 3.8
dstansby Mar 28, 2023
e9dec30
Fix detection unit tests
dstansby Mar 28, 2023
8eb78d2
Fix uint8 test failures
dstansby Mar 28, 2023
649fbb8
Improve function name
dstansby Mar 29, 2023
82668ae
Add docstring to TileWalker
dstansby Mar 29, 2023
ad7c20a
Don't force ravel
dstansby Mar 29, 2023
eb7d25f
Clean up tile logic
dstansby Mar 29, 2023
bdaf38e
Remove tile filter
dstansby Mar 29, 2023
40af6be
Document threshold setting
dstansby Mar 29, 2023
ba6e666
Remove unused variables
dstansby Mar 29, 2023
18c84c8
Remove un-used code in base_tile_filter
dstansby Mar 29, 2023
8f24beb
Add docstring to get_tile_mask
dstansby Mar 29, 2023
362c2a0
Add typing/docs to make_sphere
dstansby Mar 29, 2023
ace8d13
Add typing to bin_mean_3d
dstansby Mar 29, 2023
38be3b2
Type other array operations
dstansby Mar 29, 2023
094d21a
Add docstring to bin_mean_3d
dstansby Mar 29, 2023
f2ceace
Explain method behind kernel generation
dstansby Mar 29, 2023
49e7c4e
Simplify overlap_threshold calc
dstansby Mar 29, 2023
db6e917
Type and docstring _is_tile_to_check
dstansby Mar 29, 2023
6a994b8
Add better comments to start of walk()
dstansby Mar 29, 2023
20b88ef
Remove ball_z_size arg
dstansby Mar 29, 2023
99b176d
Type and clean _cube_overlaps
dstansby Mar 29, 2023
04452d9
Fix typing
dstansby Mar 29, 2023
0be0c80
Fix test coverage data collection
dstansby Mar 30, 2023
721ccc7
Misc classification typing (#106)
dstansby Mar 30, 2023
5b25c8e
Merge pull request #117 from dstansby/cov-cllection
alessandrofelder Mar 30, 2023
8ed73ef
Merge pull request #112 from dstansby/jit-connect-four
dstansby Mar 30, 2023
3c0bfb2
Apply tiny suggestions from code review
alessandrofelder Mar 31, 2023
c246be9
Merge pull request #121 from brainglobe/benchmarks
dstansby Mar 31, 2023
7d87ee8
Remove manifest file (#126)
dstansby Mar 31, 2023
5dd0e48
Clean up structure_centre_wrapper
dstansby Mar 31, 2023
f6c66b9
Fix typing on Python 3.8
dstansby Mar 31, 2023
a536a1b
Remove connect_eight() (#122)
dstansby Mar 31, 2023
3187752
Merge pull request #123 from dstansby/structure-cnetre
alessandrofelder Apr 3, 2023
1f1dcdc
Improve good_tiles terminology
dstansby Apr 3, 2023
a04b2b3
Migrate warning to docstring
dstansby Apr 3, 2023
eef5799
Improve walker method name
dstansby Apr 3, 2023
b3d541f
Add docstring to BallFilter
dstansby Apr 3, 2023
c761454
Add docstring to bin_arrayt
dstansby Apr 3, 2023
702bdb0
Add docstring to pad_and_bin_mean
dstansby Apr 3, 2023
46d4be6
Merge pull request #114 from dstansby/clean-tile-walker
alessandrofelder Apr 3, 2023
3876b4d
Rename good_tiles_mask
dstansby Apr 3, 2023
4b28b0c
Add notes section to bin_mean_3d docstring
dstansby Apr 3, 2023
121435c
Clean up array_operations function names
dstansby Apr 3, 2023
8a1e9c2
Merge pull request #115 from dstansby/clean-3d-filter
dstansby Apr 3, 2023
a94faf2
Test for error when data dimensionality is wrong
dstansby Apr 4, 2023
a0b9f1f
Remove some un-used code
dstansby Apr 4, 2023
e49177b
Type BallFilter
dstansby Apr 4, 2023
843316e
Make all arguments to BallFilter non-optional
dstansby Apr 4, 2023
5e353bd
Merge pull request #133 from dstansby/type-ball-filter
alessandrofelder Apr 4, 2023
a345826
Merge pull request #132 from dstansby/unused-code
alessandrofelder Apr 4, 2023
1fce9cd
Merge pull request #131 from dstansby/data-dim-error
alessandrofelder Apr 4, 2023
4b63c58
Add some docs on how bright points are marked
dstansby Apr 4, 2023
25c5b58
Clean up detect head comment
dstansby Apr 5, 2023
4145a97
Finish setup_tile_filtering comment
dstansby Apr 5, 2023
c16dee3
Merge pull request #135 from dstansby/cell-marking
alessandrofelder Apr 5, 2023
5a0e9b0
Add docs to structure detection (#138)
dstansby Apr 17, 2023
8d9c076
Use "plane" instead of "layer" in detection (#142)
dstansby Apr 18, 2023
5b0c97a
Add typing to structure splitting code (#147)
dstansby Apr 19, 2023
d9b5fc2
Collect coverage of numba decorated code (#124)
dstansby Apr 21, 2023
f210076
Only check unique neighbour IDs (#146)
dstansby Apr 21, 2023
dbae36e
Add overview docs for 2D filtering
dstansby Apr 24, 2023
1225ebd
Add 3D filtering overview docs
dstansby Apr 24, 2023
9b88c44
Add structure detection overview
dstansby Apr 24, 2023
21b7083
Start a changelog for version 0.4 (#143)
dstansby Apr 24, 2023
d0ae048
Clip plane in-place
dstansby Apr 21, 2023
f4c901b
Don't cast planes to uint64 in structure detection
dstansby Apr 21, 2023
4c34df4
Remove cibuildwheel
dstansby Apr 24, 2023
41aadf0
Update README.md
adamltyson Apr 24, 2023
46e0c67
Update README.md
adamltyson Apr 24, 2023
705cc70
Merge pull request #156 from brainglobe/readme-link
dstansby Apr 24, 2023
a4ecac0
Merge pull request #154 from brainglobe/readme-update
dstansby Apr 24, 2023
f6a913f
Fix structure splitting
dstansby Apr 24, 2023
cbad1b0
Fix typo
dstansby Apr 24, 2023
44fee23
Merge pull request #151 from dstansby/detection-docs
dstansby Apr 24, 2023
ae9ce6d
Use bool dtype for good tiles mask (#152)
dstansby Apr 25, 2023
81d339f
Put guard on uploading packages
dstansby Apr 24, 2023
60c713f
Don't include test data
dstansby Apr 24, 2023
97e6371
Merge pull request #153 from dstansby/clip-inplace
alessandrofelder Apr 26, 2023
263f0b0
Merge pull request #155 from dstansby/no-cibuildwheel
alessandrofelder Apr 28, 2023
e6d7402
Improve and test non_zero_dtype_min
dstansby Apr 28, 2023
33f61dd
Merge pull request #154 from dstansby/no-uint64
dstansby Apr 28, 2023
75e94eb
Limit number of 2D filtering outputs stored in memory
dstansby Apr 5, 2023
2b31a95
Add more docs on the locks
dstansby Apr 5, 2023
e7165a6
Move locks/mapping to separate function
dstansby Apr 5, 2023
085eb04
Improve logging
dstansby Apr 21, 2023
000b319
Increase number of planes unlocked
dstansby Apr 21, 2023
1adff82
Set n_free_cpus as in a fixture
dstansby Apr 28, 2023
45d1571
Add test for small number of planes
dstansby Apr 28, 2023
f7e9192
Fix small planes processing
dstansby Apr 28, 2023
45260c2
Add test for _map_with_locks
dstansby Apr 28, 2023
f6f99c9
Add n_free_cpus
dstansby Apr 28, 2023
c27e7b3
Merge pull request #139 from dstansby/limit-memory
alessandrofelder Apr 28, 2023
cb34613
Force typing in detect sub-module
dstansby May 2, 2023
1ef319d
Fix typo in error message
adamltyson May 4, 2023
8509157
Use nopython mode for all jitting (#165)
dstansby May 5, 2023
ca551a8
Merge branch 'main' into detect-typing
alessandrofelder May 5, 2023
787b70b
Merge pull request #161 from dstansby/detect-typing
alessandrofelder May 5, 2023
13cf4f4
Merge pull request #164 from brainglobe/typo-fix
alessandrofelder May 5, 2023
2f5f6fd
Add typing with numpy
dstansby May 2, 2023
209230e
add minimal real-life test data for structure splitting
alessandrofelder May 9, 2023
cd01b32
add smoke test for structure splitting
alessandrofelder May 9, 2023
57065c6
ensure smoke test runs on 1-cpu machine
alessandrofelder May 9, 2023
f4443f3
Merge pull request #162 from dstansby/numpy-typing
alessandrofelder May 9, 2023
4d6bce6
refactor structure splitting code for numba
alessandrofelder May 10, 2023
19be885
improve new test data naming
alessandrofelder May 11, 2023
552f138
address dstansby's review comments
alessandrofelder May 11, 2023
a48304b
avoid mixing Point and np.ndarray in same function
alessandrofelder May 11, 2023
b40d6b1
Merge branch 'main' into splitting-smoke-test
alessandrofelder May 11, 2023
8b2d1d6
fix typing and linting
alessandrofelder May 15, 2023
b276658
fix typing bug noticed in review
alessandrofelder May 16, 2023
7f4f92e
wip: tests fail
alessandrofelder May 16, 2023
a802047
Merge pull request #167 from brainglobe/splitting-smoke-test
dstansby May 16, 2023
66da700
Add 0.4.0 to changelog
dstansby May 17, 2023
1678d43
delete cell detection doc (#174)
adamltyson Jun 16, 2023
a0f58a3
Update links (#156)
adamltyson Jun 19, 2023
d5c2391
[pre-commit.ci] pre-commit autoupdate (#176)
pre-commit-ci[bot] Jun 20, 2023
6a31e05
[pre-commit.ci] pre-commit autoupdate (#158)
pre-commit-ci[bot] Jun 20, 2023
bd0c121
Update links (#175)
adamltyson Jun 20, 2023
b69cdef
Fix dynamic versioning (#177)
willGraham01 Jun 22, 2023
1c57474
Fix mypy type checking (#180)
dstansby Jun 23, 2023
9de1afd
Add typing to classification (#181)
dstansby Jun 23, 2023
172d19b
Update dependency (imlib -> brainglobe-utils) (#182)
adamltyson Jun 26, 2023
5dbfab2
Update dependency (imlib -> brainglobe-utils) (#159)
adamltyson Jun 26, 2023
2a42d36
[pre-commit.ci] pre-commit autoupdate (#183)
pre-commit-ci[bot] Jun 27, 2023
73e83d7
[pre-commit.ci] pre-commit autoupdate (#160)
pre-commit-ci[bot] Jun 27, 2023
d642e34
Forbid import when `tensorflow` is not installed (#186)
willGraham01 Jul 3, 2023
9425a82
[pre-commit.ci] pre-commit autoupdate (#161)
pre-commit-ci[bot] Jul 4, 2023
9b18653
[pre-commit.ci] pre-commit autoupdate (#189)
pre-commit-ci[bot] Jul 4, 2023
176cec1
Update README in light of noarch build (#191)
willGraham01 Jul 5, 2023
6e3864a
Update CHANGELOG with 0.5.0 changes (#192)
willGraham01 Jul 6, 2023
a8b8992
MANIFEST only necessary files for package install (#195)
willGraham01 Jul 7, 2023
b387053
[pre-commit.ci] pre-commit autoupdate (#196)
pre-commit-ci[bot] Jul 11, 2023
2005651
[pre-commit.ci] pre-commit autoupdate (#162)
pre-commit-ci[bot] Jul 11, 2023
31a5369
Update links (#163)
adamltyson Jul 13, 2023
224e0b3
possible fix for mac error (#200)
alessandrofelder Jul 14, 2023
0dc6878
CI Check against `tensorflow` include guard (#204)
willGraham01 Jul 18, 2023
a989125
[pre-commit.ci] pre-commit autoupdate (#164)
pre-commit-ci[bot] Jul 18, 2023
9e7c951
[pre-commit.ci] pre-commit autoupdate (#205)
pre-commit-ci[bot] Jul 18, 2023
58141d7
ensure cellfinder-core can run on single cpu (#198)
alessandrofelder Jul 19, 2023
90c6c25
asv benchmarks for imports and tools modules (#184)
sfmig Jul 24, 2023
571b787
[pre-commit.ci] pre-commit autoupdate (#210)
pre-commit-ci[bot] Jul 25, 2023
d3b760b
[pre-commit.ci] pre-commit autoupdate (#165)
pre-commit-ci[bot] Jul 25, 2023
63bc952
[pre-commit.ci] pre-commit autoupdate (#166)
pre-commit-ci[bot] Aug 1, 2023
421c89b
[pre-commit.ci] pre-commit autoupdate (#211)
pre-commit-ci[bot] Aug 1, 2023
45a4f6a
Update links (#212)
adamltyson Aug 1, 2023
832bbed
[pre-commit.ci] pre-commit autoupdate (#167)
pre-commit-ci[bot] Aug 8, 2023
85274a1
[pre-commit.ci] pre-commit autoupdate (#213)
pre-commit-ci[bot] Aug 8, 2023
ed7383d
[pre-commit.ci] pre-commit autoupdate (#169)
pre-commit-ci[bot] Aug 17, 2023
f38b212
[pre-commit.ci] pre-commit autoupdate (#214)
pre-commit-ci[bot] Aug 17, 2023
16444e7
Update CI deployment to use NI unit actions (#168)
willGraham01 Aug 21, 2023
5fab318
[pre-commit.ci] pre-commit autoupdate (#170)
pre-commit-ci[bot] Aug 22, 2023
740f487
Set pre-commit autoupdate frequency to monthly (#217)
adamltyson Aug 22, 2023
a462565
[pre-commit.ci] pre-commit autoupdate (#216)
pre-commit-ci[bot] Aug 22, 2023
c229629
Restructure under cellfinder umbrella
willGraham01 Aug 23, 2023
1ec39bf
Rename most of the cellfinder_core to cellfinder.core
willGraham01 Aug 23, 2023
574e624
cellfinder_core tests now just in core
willGraham01 Aug 23, 2023
9ffee87
Separate cellfinder-core config files in prep for merge
willGraham01 Aug 23, 2023
b6c99fb
Merge cellfinder-napari into cellfinder-core
willGraham01 Aug 23, 2023
7e8d44e
Rename cellfinder-napari to cellfinder.napari
willGraham01 Aug 23, 2023
058eeb7
Move cellfinder.napari tests into test directory
willGraham01 Aug 23, 2023
a57c5dd
Move cellfinder napari config files into temporary subdirectory
willGraham01 Aug 23, 2023
7c32862
Reconcile licenses
willGraham01 Aug 23, 2023
3263080
Reconcile pre-commits
willGraham01 Aug 23, 2023
f115785
Reconcile pyproject.tomls
willGraham01 Aug 23, 2023
52b872b
Reconcile manifests
willGraham01 Aug 24, 2023
b84bd24
Reinstate cellfinder-core changelog
willGraham01 Aug 24, 2023
6075227
Reinstate .codedov
willGraham01 Aug 24, 2023
0fdefea
Reinstate plugin preview workflow
willGraham01 Aug 24, 2023
0dec9bc
Reconcile tox
willGraham01 Aug 24, 2023
a14889f
Reconcile READMEs temporarily
willGraham01 Aug 24, 2023
d907858
Reconcile CI workflows
willGraham01 Aug 24, 2023
1e7829b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 24, 2023
dfcedf7
mypy to ignore things
willGraham01 Aug 24, 2023
3627c62
Merge branch 'cellfinder-merge' of github.com:brainglobe/cellfinder-c…
willGraham01 Aug 24, 2023
f18f840
Disable mypy for time being
willGraham01 Aug 24, 2023
3bc4f4e
Fix plugin things by moving to non-flat directory struture
willGraham01 Aug 24, 2023
e276749
Move to flat directory structure.
willGraham01 Aug 29, 2023
67dec4c
Explicitly add napari.yaml to MANIFEST
willGraham01 Aug 29, 2023
9fe13ff
Make napari functionality optional
willGraham01 Aug 31, 2023
d086030
Remove napari plugin preview workflow (#251)
willGraham01 Sep 1, 2023
e6a5521
Clean out cellfinder (old) to make way for merge
willGraham01 Nov 27, 2023
7b29e91
Merge cellfinder-core and cellfinder-napari into this package.
willGraham01 Nov 27, 2023
97f9e0d
Force headless display.
willGraham01 Nov 27, 2023
f9f957e
Direct cellfinder-CLI to only run cellfinder-related tests from workf…
willGraham01 Nov 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
comment: false


# Add a numba flag to any files that contain code jit compiled
# with numba. Tests are run without Numba compilation on the main
# branch to collect code coverage, and the carryforward flags are
# used to make sure coverage of these files does not decrease on
# pull requests.
flags:
numba:
paths:
- cellfinder/core/detect/filters/plane/tile_walker.py
- cellfinder/core/detect/filters/volume/ball_filter.py
- cellfinder/core/detect/filters/volume/structure_detection.py
carryforward: true
141 changes: 79 additions & 62 deletions .github/workflows/test_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -1,107 +1,124 @@
name: tests

on:
# Only run on pushes to main, or when version tags are pushed
push:
branches:
- "main"
tags:
- "*"
- "v**"
# Run on all pull-requests
pull_request:
# Allow workflow dispatch from GitHub
workflow_dispatch:
inputs:
coredev:
description: 'Tests with development version of cellfinder-core?'
required: true
default: 'false'

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
concurrency:
# Cancel this workflow if it is running,
# and then changes are applied on top of the HEAD of the branch,
# triggering another run of the workflow
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/lint@v2

manifest:
name: Check manifest
name: Check Manifest
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/check_manifest@v2

test:
needs: [linting,manifest]
needs: [linting, manifest]
name: Run package tests
runs-on: ${{ matrix.os }}
env:
INPUT_COREDEV: ${{ github.event.inputs.coredev }}
strategy:
fail-fast: false
matrix:
# Run across a mixture of Python versions and operating systems
# Run all supported Python versions on linux
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10"]
# Include one windows, one macos run
include:
- os: macos-latest
python-version: "3.10"
- os: windows-latest
python-version: "3.9"
- os: ubuntu-latest
python-version: "3.10"

steps:
# Cache the tensorflow model so we don't have to remake it every time
- name: Cache tensorflow model
uses: actions/cache@v3
with:
path: "~/.cellfinder"
key: models-${{ hashFiles('~/.cellfinder/**') }}
# Setup pyqt libraries
- name: Setup qtpy libraries
uses: tlambert03/setup-qt-libs@v1
# Setup VTK with headless display
- uses: pyvista/setup-headless-display-action@v2
# Run all tests
- uses: neuroinformatics-unit/actions/test@v2
with:
python-version: ${{ matrix.python-version }}
use-xvfb: true

build_sdist_wheels:
name: Build source distribution
needs: [test]
if: github.event_name == 'push' && github.ref_type == 'tag'
# Run brainglobe-workflows cellfinder-CLI tests to check for
# breakages
test_cellfinder_cli:
needs: [linting, manifest]
name: Run cellfinder CLI to check for breakages
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/build_sdist_wheels@v2
- name: Cache tensorflow model
uses: actions/cache@v3
with:
path: "~/.cellfinder"
key: models-${{ hashFiles('~/.cellfinder/**') }}

deploy:
needs: [build_sdist_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref_type == 'tag'
steps:
- uses: actions/download-artifact@v3
- name: Checkout brainglobe-workflows
uses: actions/checkout@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
repository: 'brainglobe/brainglobe-workflows'

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
user: __token__
password: ${{ secrets.TWINE_API_KEY }}
python-version: "3.10"

build-and-push-docker:
needs: deploy
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
- name: Install test dependencies
run: |
python -m pip install --upgrade pip wheel
# Install latest SHA on this cellfinder branch
python -m pip install git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@$GITHUB_SHA
# Install checked out copy of brainglobe-workflows
python -m pip install .[dev]

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Run cellfinder CLI test from brainglobe-workflows
run: |
python -m pytest --color=yes -v tests/cellfinder

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
build_sdist_wheel:
name: Build source distribution and wheel
needs: [test, test_cellfinder_cli]
if: github.event_name == 'push' && github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/build_sdist_wheels@v2

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
upload_all:
name: Publish build distributions
needs: [build_sdist_wheel]
if: github.event_name == 'push' && github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TWINE_API_KEY }}
60 changes: 60 additions & 0 deletions .github/workflows/test_include_guard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Test Tensorflow include guards
# These tests check that the include guards checking for tensorflow's availability
# behave as expected on ubuntu and macOS.

on:
pull_request:
push:
branches:
- main

jobs:
tensorflow_guards:
name: Test include guards
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install via pip
run: python -m pip install -e .

- name: Test (working) import
uses: jannekem/run-python-script-action@v1
with:
fail-on-error: true
script: |
import cellfinder.core
import cellfinder.napari

- name: Uninstall tensorflow
run: python -m pip uninstall -y tensorflow

- name: Test (broken) import
id: broken_import
uses: jannekem/run-python-script-action@v1
with:
fail-on-error: false
script: |
import cellfinder.core

# exit 1 will force an actions exit with a failure reported
- name: Flag error thrown by broken import
if: steps.broken_import.outputs.error == 'false'
run: |
echo "Broken import test result was: ${{ steps.broken_import.outputs.error }}"
exit 1

# add an additional step to confirm an error occurred in the import
- name: Confirm error was thrown by broken import
if: steps.broken_import.outputs.error == 'true'
run: |
echo "Broken import test result was: ${{ steps.broken_import.outputs.error }}"
27 changes: 27 additions & 0 deletions .github/workflows/test_numba_off.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test with numba turned off
# These tests are relatively slow (~20 minutes), but are used
# to collect code coverage on areas of code that are otherwise
# optimised by numba.

on:
push:
branches: [ main ]


jobs:
test_numba_disabled:
name: Run tests
runs-on: ubuntu-latest
env:
NUMBA_DISABLE_JIT: "1"

steps:
- name: Cache tensorflow model
uses: actions/cache@v3
with:
path: "~/.cellfinder"
key: models-${{ hashFiles('~/.cellfinder/**') }}
- uses: neuroinformatics-unit/actions/test@v2
with:
python-version: "3.10"
codecov-flags: "numba"
25 changes: 22 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*.conf.custom

# Byte-compiled / optimized / DLL files
**/__pycache__/**
**/__pycache__/
*.py[cod]
*$py.class

Expand All @@ -15,6 +15,7 @@

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
Expand Down Expand Up @@ -53,6 +54,7 @@ coverage.xml
*.cover
.hypothesis/
.pytest_cache/
.napari_cache/

# Translations
*.mo
Expand All @@ -77,10 +79,13 @@ doc/build/
_build/
mkdocs.yml

# MkDocs documentation
/site/

# PyBuilder
target/

# Jupyter Notebook
# IPython Notebook
.ipynb_checkpoints

# pyenv
Expand Down Expand Up @@ -121,6 +126,20 @@ venv.bak/

pip-wheel-metadata/

mprofile*.dat

*.DS_Store

*.vscode/
# asv
.asv
benchmarks/results
benchmarks/html
benchmarks/env

# OS
.DS_Store

# written by setuptools_scm
*/_version.py

.idea/
14 changes: 14 additions & 0 deletions .napari/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Add labels from the EDAM Bioimaging ontology
labels:
ontology: EDAM-BIOIMAGING:alpha06
terms:
- Image feature detection
- 3D image
- Image registration
- Multi-photon microscopy
- Light-sheet microscopy
- Image segmentation
- Image thresholding
- Image annotation
- Object classification
- Object feature extraction
13 changes: 3 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.4.0
hooks:
- id: check-docstring-first
- id: check-executables-have-shebangs
Expand All @@ -16,17 +16,10 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
rev: v0.0.285
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.10.1
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.6.1
hooks:
- id: mypy
additional_dependencies:
- types-setuptools
- types-requests
Loading
Loading