Skip to content

Commit

Permalink
Merge pull request #56 from jjjermiah/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
jjjermiah committed Jan 28, 2024
2 parents e20d4af + 1ba3d1e commit fb09228
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 99 deletions.
116 changes: 54 additions & 62 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Unit Tests
on:
push:
# push to any branch
branches: [ main ]
branches: [ main, development]
pull_request:
branches: [ main ]

Expand All @@ -31,20 +31,39 @@ jobs:
run: |
pip install -r requirements.txt
poetry install
pytest --cov --cov-report=xml
pytest --cov --cov-report=xml:coverage-report/coverage.xml
- name: Build documentation
run: poetry run make html --directory docs/

- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: coverage-report
path: coverage-report

Codecov:
needs: Continuous-Integration
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download coverage.xml artifact
uses: actions/download-artifact@v2
with:
name: coverage-report
path: coverage-report

- name: Use Codecov to track coverage
uses: codecov/codecov-action@v3
with:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
files: ./coverage-report/coverage.xml
fail_ci_if_error: true
verbose: true
name: codecov-umbrella

- name: Build documentation
run: poetry run make html --directory docs/

Continuous-Deployment:
permissions:
contents: write
Expand Down Expand Up @@ -170,57 +189,30 @@ jobs:
ghcr.io/${{ github.repository }}/nbiatoolkit:latest
labels: ${{ steps.meta.outputs.labels }}

- name: Test Image
if: steps.release.outputs.released == 'true'
run: |
docker run --rm \
${{ secrets.DOCKERHUB_USERNAME }}/nbiatoolkit:${{ env.DOCKER_IMAGE_TAG }} \
python -c "import nbiatoolkit; print(nbiatoolkit.__version__)"
# # - name: Publish package distributions to GitHub Releases
# - name: Build and Publish
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/
# build: true
# build_command: poetry build
# build_command_postfix: dist/*

# - name: Publish package distributions to PyPI
# id: pypi-publish



# - name: Publish package distributions to GitHub Releases
# uses: python-semantic-release/upload-to-gh-release@main
# if: steps.release.outputs.released == 'true'
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# - name: Publish to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository_url: https://test.pypi.org/legacy/

# - name: Test install from TestPyPI
# run: |
# pip install \
# --index-url https://test.pypi.org/simple/ \
# --extra-index-url https://pypi.org/simple \
# nbiatoolkit

# - name: Publish to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}

# - name: Publish documentation
# uses: maxheld83/ghpages@v0.2.1
# with:
# build_dir: docs/_build/html
# target_branch: gh-pages
# committer_name: "GitHub Actions"
# committer_email: "jermiahjoseph98@gmail.com"
test_image_with_new_tag:
needs: Continuous-Deployment
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Test Image With new Tag
if: needs.build.result == 'success'
run: |
docker run --rm \
${{ secrets.DOCKERHUB_USERNAME }}/nbiatoolkit:${{ env.DOCKER_IMAGE_TAG }} \
python -c "import nbiatoolkit; print(nbiatoolkit.__version__)"
test_image_with_latest_tag:
needs: Continuous-Deployment
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Test Image with "latest" Tag
if: needs.build.result == 'success'
run: |
docker run --rm \
${{ secrets.DOCKERHUB_USERNAME }}/nbiatoolkit:latest \
python -c "import nbiatoolkit; print(nbiatoolkit.__version__)"
38 changes: 1 addition & 37 deletions src/nbiatoolkit/nbia.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,40 +258,4 @@ def parsePARAMS(self, params: dict) -> dict:
pprint(all)

sub = client.getCollections(prefix="aCrin")
pprint(sub)
# collections = client.getCollections()
# pprint(collections[0:5])
# seriesJSON = client.getSeries(Collection="4D-Lung")
# # first get a list of the SeriesInstanceUIDs
# seriesUIDS = [series['SeriesInstanceUID'] for series in seriesJSON]
# pprint(seriesUIDS[0:5])

# seriesUIDS = [
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.189721824525842725510380467695',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.336250251691987239290048605884',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.227929163446067537882961857921',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.925990093742075237571072608963',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.139116724721865252687455544825',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.364787732307640672278270360328',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.384197169742944248273003912317',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.149750833495190982103087204448',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.300347070051003027185063750283',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.317831614083862743715273480521',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.736089011729021729851027177073',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.133381852562664457904201355429',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.909088026336573109170906532418',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.953079890279542310843831057254',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.427052348021168186336245283790',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.295010883410722294053941635303',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.263257070197787007872578860295',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.672179203515231442641005032212',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.184961274239908956209701869504',
# '1.3.6.1.4.1.14519.5.2.1.6834.5010.797307942821711099898506950104']

# downloadDir = "./data"
# os.makedirs(downloadDir, exist_ok=True)

# client.downloadSeries(
# seriesUIDS, downloadDir, overwrite=True, nParallel=8)

# pprint(os.listdir(downloadDir))
pprint(sub)

0 comments on commit fb09228

Please sign in to comment.