-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from gerlichlab/vr/v2-more-granular-partition-…
…of-spots More granular spots partition, v0.2.0
- Loading branch information
Showing
22 changed files
with
467 additions
and
570 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 |
---|---|---|
|
@@ -8,99 +8,12 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
# See: https://hynek.me/articles/ditch-codecov-python/ | ||
test-with-coverage: | ||
pytest: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.10", "3.11" ] | ||
os: [ ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install project | ||
run: python -Im pip install .[coverage,testsuite] | ||
- name: Test and measure coverage, on Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
run: coverage run --omit=tests/*.py --data-file=.coverage.$(echo ${{ matrix.python-version }} | tr -d .) -m pytest -vv | ||
- name: Upload coverage data | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
# To be kept in sync with combiner step to follow | ||
name: coverage-data-${{ matrix.python-version }} | ||
path: .coverage.* | ||
if-no-files-found: ignore | ||
|
||
# See: https://hynek.me/articles/ditch-codecov-python/ | ||
report-coverage: | ||
name: Combine, report, and check coverage | ||
needs: test-with-coverage # To be kept in sync with name of coverage-emitting job | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
# Only need to RUN with one Python here, and it shouldn't really matter which one. | ||
python-version: "3.11" | ||
cache: pip | ||
- run: python -Im pip install coverage | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
# To be kept in sync with upload/emission step already done | ||
pattern: coverage-data-* | ||
merge-multiple: true | ||
- name: Combine coverage & fail if it's <100%. | ||
run: | | ||
python -Im coverage combine | ||
#python -Im coverage html --skip-covered --skip-empty | ||
python -Im coverage html | ||
# Report and write to summary. | ||
python -Im coverage report --format=markdown >> $GITHUB_STEP_SUMMARY | ||
# Report and write to JSON for parsing for badge. | ||
# See: https://github.com/nedbat/coveragepy/blob/8ab9ff17409e3f6f3f5f2c0076d8b3250e8da4a0/coverage/jsonreport.py#L62-L67 | ||
python -Im coverage json --pretty-print | ||
export TOTAL_COVERAGE_PERCENTAGE=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])") | ||
export COVER_STATEMENTS=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['covered_lines'])") | ||
export TOTAL_STATEMENTS=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['num_statements'])") | ||
echo "cov_pct=$TOTAL_COVERAGE_PERCENTAGE" >> $GITHUB_ENV | ||
echo "covered_statement_count=$COVER_STATEMENTS" >> $GITHUB_ENV | ||
echo "total_statement_count=$TOTAL_STATEMENTS" >> $GITHUB_ENV | ||
# Report again and fail if under 100%. | ||
python -Im coverage report --fail-under=100 | ||
- name: Upload HTML report if check failed. | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: html-report | ||
path: htmlcov | ||
if: ${{ failure() }} | ||
|
||
# See: https://nedbatchelder.com/blog/202209/making_a_coverage_badge.html | ||
- name: Create coverage status badge | ||
uses: schneegans/[email protected] | ||
with: | ||
auth: ${{ secrets.GIST_BADGE_SECRET }} | ||
gistID: ce02631685f3de397aee6ec83036cf34 | ||
filename: cov_badge__looptrace-regionals-vis.json | ||
label: Coverage | ||
message: ${{ env.cov_pct }}% (${{ env.covered_statement_count }} of ${{ env.total_statement_count }}) | ||
minColorRange: 50 | ||
maxColorRange: 90 | ||
valColorRange: ${{ env.cov_pct }} | ||
|
||
other-tests: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ "3.10", "3.11" ] | ||
os: [ macos-latest, ubuntu-20.04 ] | ||
os: [ macos-latest, ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
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
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
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
"""Colors used for data visualisation""" | ||
|
||
INDIGO = "#332288" # for unfiltered | ||
PALE_SKY_BLUE = "#88CCEE" # for too-proximal | ||
PALE_RED_CLAY = "#CC6677" # for proximity-filtered, nuclei retained | ||
__all__ = ["IBM_BLUE", "IBM_PURPLE", "IBM_PINK", "IBM_ORANGE", "IBM_YELLOW"] | ||
|
||
IBM_BLUE = "#648FFF" # for merge contributors | ||
IBM_PURPLE = "#785EF0" # for proximity discards | ||
IBM_PINK = "#DC267F" # for accepted singletons | ||
IBM_ORANGE = "#FE6100" # for non-nuclear | ||
IBM_YELLOW = "FFB000" # for accepted mergers |
Oops, something went wrong.