-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 201-bugfix-remove-references-to-sites-where-…
…data-originated-from
- Loading branch information
Showing
226 changed files
with
6,697 additions
and
8,009 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 |
---|---|---|
|
@@ -4,4 +4,4 @@ updates: | |
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
interval: "monthly" |
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,39 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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,114 @@ | ||
# Runs on pull request or release - checks CLI tools are working without raising exception | ||
|
||
|
||
name: CLI tests | ||
|
||
on: | ||
pull_request: | ||
release: | ||
|
||
jobs: | ||
test_cli: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ '3.9', '3.10' ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest pytest-cov | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Install hazen | ||
run: | | ||
pip install . | ||
- name: test snr | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen snr tests/data/snr/Siemens --report | ||
hazen snr tests/data/snr/Siemens --measured_slice_width 5.0012 --report | ||
- name: test_acr_snr | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen acr_snr tests/data/acr/Siemens --report | ||
hazen acr_snr tests/data/acr/Siemens --subtract tests/data/acr/Siemens2 --report | ||
- name: test acr_uniformity | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen acr_uniformity tests/data/acr/Siemens --report | ||
- name: test acr_ghosting | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen acr_ghosting tests/data/acr/Siemens --report | ||
- name: test acr_slice_position | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen acr_slice_position tests/data/acr/Siemens --report | ||
- name: test acr_slice_thickness | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen acr_slice_thickness tests/data/acr/Siemens --report | ||
- name: test acr_geometric_accuracy | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen acr_geometric_accuracy tests/data/acr/Siemens --report | ||
- name: test acr_spatial_resolution | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen acr_spatial_resolution tests/data/acr/SiemensMTF --report | ||
- name: test slice_position | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen slice_position tests/data/slicepos/SLICEPOSITION --report | ||
- name: test slice_width | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen slice_width tests/data/slicewidth/512_matrix --report | ||
hazen slice_width tests/data/slicewidth/SLICEWIDTH --report | ||
- name: test spatial_resolution | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen spatial_resolution tests/data/resolution/RESOLUTION/ --report | ||
- name: test uniformity | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen uniformity tests/data/uniformity --report | ||
- name: test ghosting | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen ghosting tests/data/ghosting/GHOSTING --report | ||
hazen ghosting tests/data/ghosting/PE_COL_PHANTOM_BOTTOM_RIGHT --report | ||
- name: test snr_map | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen snr_map tests/data/snr/Siemens --report | ||
- name: test relaxometry | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen relaxometry tests/data/relaxometry/T1/site1_20200218/plate5 --calc_t1 --plate_number=5 --report | ||
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 |
---|---|---|
|
@@ -18,30 +18,12 @@ jobs: | |
defaults: | ||
run: | ||
shell: bash -l {0} | ||
# Service containers to run with `container-job` | ||
services: | ||
# Label used to access the service container | ||
postgres: | ||
# Docker Hub image | ||
image: postgres | ||
# Provide the password for postgres | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_DB: hazen_test | ||
POSTGRES_USER: test_user | ||
POSTGRES_PASSWORD: test_user_password | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
|
@@ -76,45 +58,3 @@ jobs: | |
with: | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
junitxml-path: ./pytest.xml | ||
|
||
- name: Update the coverage Badge | ||
if: github.event.pull_request.base.ref == 'main' # if pull request is merging into main | ||
uses: schneegans/[email protected] | ||
with: | ||
auth: ${{ secrets.PYTEST_COVERAGE_COMMENT }} | ||
gistID: ba102d5f3e592fcd50451c2eff8a803d | ||
filename: hazen_pytest-coverage-comment.json | ||
label: Test coverage | ||
message: ${{ steps.coverageComment.outputs.coverage }} | ||
color: ${{ steps.coverageComment.outputs.color }} | ||
namedLogo: python | ||
|
||
test_cli: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ '3.9', '3.10' ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest pytest-cov | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Install hazen | ||
run: | | ||
python setup.py install | ||
- name: test snr | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen snr tests/data/snr/Siemens --report |
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 |
---|---|---|
|
@@ -17,31 +17,12 @@ jobs: | |
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ '3.9', '3.10' ] | ||
# Service containers to run with `container-job` | ||
services: | ||
# Label used to access the service container | ||
postgres: | ||
# Docker Hub image | ||
image: postgres | ||
# Provide the password for postgres | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_DB: hazen_test | ||
POSTGRES_USER: test_user | ||
POSTGRES_PASSWORD: test_user_password | ||
# Set health checks to wait until postgres has started | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
|
@@ -56,32 +37,20 @@ jobs: | |
set -Eeuxo pipefail | ||
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=hazenlib tests/ | tee pytest-coverage.txt ; echo $? | ||
test_cli: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ '3.9', '3.10' ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest pytest-cov | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Install hazen | ||
run: | | ||
python setup.py install | ||
- name: Pytest coverage comment | ||
id: coverageComment | ||
uses: MishaKav/pytest-coverage-comment@main | ||
with: | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
junitxml-path: ./pytest.xml | ||
|
||
- name: test snr | ||
if: always() # will always run regardless of whether previous step fails - useful to ensure all CLI functions tested | ||
run: | | ||
hazen snr tests/data/snr/Siemens --report | ||
- name: Update the coverage Badge | ||
uses: schneegans/[email protected] | ||
with: | ||
auth: ${{ secrets.PYTEST_COVERAGE_COMMENT }} | ||
gistID: ba102d5f3e592fcd50451c2eff8a803d | ||
filename: hazen_pytest-coverage-comment.json | ||
label: Test coverage | ||
message: ${{ steps.coverageComment.outputs.coverage }} | ||
color: ${{ steps.coverageComment.outputs.color }} | ||
namedLogo: python |
Oops, something went wrong.