Skip to content

Commit

Permalink
Merge pull request #295 from GSTT-CSC/294-pypi-package-build-is-failing
Browse files Browse the repository at this point in the history
update numpy and move code coverage badge update to release tests
  • Loading branch information
heyhaleema authored Jan 3, 2023
2 parents 01046cb + 78499d9 commit 90f4fa1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/tests_development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +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
17 changes: 17 additions & 0 deletions .github/workflows/tests_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,20 @@ jobs:
set -Eeuxo pipefail
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=hazenlib tests/ | tee pytest-coverage.txt ; echo $?
- name: Pytest coverage comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml

- 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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# After making changes for core components please update install_requires in setp.py as well
pydicom==2.2.2
numpy==1.21.4
numpy==1.24.1
matplotlib==3.5.1
pytest==7.1.2
docopt==0.6.2
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from hazenlib import __version__

install_requires = ['pydicom==2.2.2',
'numpy==1.21.4',
'numpy==1.24.1',
'matplotlib==3.5.1',
'docopt==0.6.2',
'opencv-python-headless==4.6.0.66',
Expand Down
5 changes: 3 additions & 2 deletions tests/test_spatial_resolution.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
import pathlib
import pytest

import numpy as np
import pydicom
Expand Down Expand Up @@ -414,8 +415,8 @@ def test_mtf(self):

def test_calculate_mtf(self):
res = self.hazen_spatial_resolution.calculate_mtf(self.hazen_spatial_resolution.data[0])
assert res['frequency_encoding_direction'] == self.MTF_FE
assert res['phase_encoding_direction'] == self.MTF_PE
assert res['frequency_encoding_direction'] == pytest.approx(self.MTF_FE)
assert res['phase_encoding_direction'] == pytest.approx(self.MTF_PE)


class TestPhilipsResolution(TestSpatialResolution):
Expand Down

2 comments on commit 90f4fa1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.