Skip to content

Commit

Permalink
Merge pull request #84 from jjjermiah/49-feature-getupdatedseries
Browse files Browse the repository at this point in the history
49 feature getupdatedseries
  • Loading branch information
jjjermiah committed Feb 4, 2024
2 parents 67fb6e4 + 99c5777 commit 440d9b4
Show file tree
Hide file tree
Showing 11 changed files with 331 additions and 40 deletions.
47 changes: 29 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ jobs:

- name: Test with pytest
run: |
poetry run pytest -n 2 --cov --cov-report xml:coverage-report/coverage.xml
# Github action runners now have 4 cores
poetry run pytest -n 4 --cov --cov-report xml:coverage-report/coverage.xml
- name: Build documentation
run: poetry run make html --directory docs/

- name: Upload coverage report
- name: Upload coverage report artifact to be used by Codecov
uses: actions/upload-artifact@v2
with:
name: coverage-report
Expand Down Expand Up @@ -65,6 +63,29 @@ jobs:
verbose: true
name: codecov-umbrella

Build-Documentation:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12

- name: Install poetry
uses: snok/install-poetry@v1

- name: Install dependencies
run: poetry install

- name: Build documentation
run: |
poetry run make html --directory docs/
Continuous-Deployment:
Expand All @@ -74,10 +95,10 @@ jobs:
issues: write
pull-requests: write

# needs: Continuous-Integration
needs: [Continuous-Integration, Build-Documentation]

# if pulling to main, deploy to PyPI
# if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main'

# Set up operating system
runs-on: ubuntu-latest
Expand All @@ -100,11 +121,6 @@ jobs:
- name: Install package
run: poetry install


# Existing jobs...



# This action uses Python Semantic Release v8
# What this action does:
# - Determines the next version number based on the commit history
Expand All @@ -116,7 +132,6 @@ jobs:
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_commit_message: 'chore(release): release ${next_version}'

- name: Install packaging-related tool
run:
Expand All @@ -142,10 +157,6 @@ jobs:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Print latest tag name
run: |
printf "%s\n" "${LATEST_TAG}"
- name: Print branch name
run: |
printf "LATEST TAG: %s\n" "${LATEST_TAG}"
Expand Down Expand Up @@ -321,7 +332,7 @@ jobs:
git add .
# Commit with a timestamp
git commit -m "Update README with latest version: $LATEST_TAG"
git commit -m "chore: Update README: $LATEST_TAG"
# Push changes to the remote repository
# if github.head_ref is not null
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,5 @@ driver.py
data/*
sandbox

docs/data/*
docs/data/*
docs/autoapi
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@
# docker build -t nbiatoolkit .
#
# ADD LABELS HERE

FROM python:3.12-slim

LABEL maintainer="Jermiah Joseph"
LABEL maintainer="Jermiah Joseph jermiahjoseph98@gmail.com"
LABEL description="This is a Dockerfile for the nbiatoolkit package."
LABEL license="MIT"
LABEL usage="docker run -it --rm <image_name> NBIAToolkit --help"
LABEL org.opencontainers.image.source="github.com/jjjermiah/nbiatoolkit"

# install the dependencies
RUN pip install --upgrade pip
RUN python -m pip install nbiatoolkit

RUN python -c 'import nbiatoolkit; print(nbiatoolkit.version())'
RUN NBIAToolkit --help

# On run, open a bash shell
CMD ["/bin/bash"]
Expand Down
51 changes: 49 additions & 2 deletions docs/Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -44,7 +44,7 @@
{
"data": {
"text/plain": [
"'0.18.1'"
"'0.22.1'"
]
},
"execution_count": 2,
Expand Down Expand Up @@ -668,6 +668,53 @@
"pprint(seriesbyPatientJSON[0])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### get New Series after a given date\n",
"\n",
"``` python\n",
"getNewSeries(\n",
" Date: Union[str, datetime], # (required) accepted formats:\n",
" # \"%Y-%m-%d\", \"%Y/%m/%d\", \"%Y%m%d\", \n",
" # \"%m/%d/%Y\", \"%d/%m/%Y\", \"%d-%m-%Y\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"01/01/2024\n",
"Total new series after 2024-01-01: 4751\n",
"{'BodyPartExamined': 'BREAST',\n",
" 'Collection': 'Advanced-MRI-Breast-Lesions',\n",
" 'ImageCount': 580,\n",
" 'Manufacturer': 'GE MEDICAL SYSTEMS',\n",
" 'ManufacturerModelName': 'Signa HDxt',\n",
" 'Modality': 'MR',\n",
" 'PatientID': 'AMBL-376',\n",
" 'SeriesDate': '2005-04-14 00:00:00.0',\n",
" 'SeriesDescription': 'AX Sen Vibrant MultiPhase',\n",
" 'SeriesInstanceUID': '1.3.6.1.4.1.14519.5.2.1.196168555404542578475976858220037429361',\n",
" 'SeriesNumber': 5,\n",
" 'SoftwareVersions': '24',\n",
" 'StudyInstanceUID': '1.3.6.1.4.1.14519.5.2.1.201692485188138093977458202425301357349'}\n"
]
}
],
"source": [
"newSeries = client.getNewSeries(Date=\"2024/01/01\")\n",
"print(f\"Total new series after 2024-01-01: {len(newSeries)}\")\n",
"pprint(newSeries[0])"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
139 changes: 138 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 440d9b4

Please sign in to comment.