This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collect coverage of numba decorated code (#124)
* Add a test without numba enabled * Try global disable-numba variable * Fix matrix name * Add numba codecov flag. * Add test specifically for numba code coverage * Clean test file and codecov file * Pass codecov flags * Use v2 of NI actions * Only run on main
- Loading branch information
Showing
4 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +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: | ||
- src/cellfinder_core/detect/filters/plane/tile_walker.py | ||
- src/cellfinder_core/detect/filters/volume/ball_filter.py | ||
- src/cellfinder_core/detect/filters/volume/structure_detection.py | ||
carryforward: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,5 @@ deps = | |
pytest | ||
pytest-cov | ||
pytest-timeout | ||
passenv = | ||
NUMBA_DISABLE_JIT |