Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,40 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: pyproject.toml
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install ".[test,preproc,plot]"
- name: Install libomp (macOS)
if: runner.os == 'macOS'
run: brew install libomp
- name: Test with pytest
run: |
pip install pytest pytest-cov
python -m pytest --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html -r w ${{ runner.os == 'macOS' && '-k "not test_deep_learning_algorithms"' || '' }}
python -m pytest --doctest-modules --junitxml=junit/test-results-brain.xml --cov=. --cov-report=xml --cov-report=html --dataFile tests/IVIMmodels/unit_tests/generic_brain.json -r w -k test_ivim_fit_saved

# Requirements.txt test run -> hashed pinned versions
lock:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install torch --extra-index-url https://download.pytorch.org/whl/cpu
pip install -r requirements.txt
- name: Test with pytest
run: |
pip install pytest pytest-cov
python -m pytest --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html -r w
python -m pytest --doctest-modules --junitxml=junit/test-results-brain.xml --cov=. --cov-report=xml --cov-report=html --dataFile tests/IVIMmodels/unit_tests/generic_brain.json -r w -k test_ivim_fit_saved
20 changes: 13 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ authors = [
{name = "Oliver J. Gurney-Champion", email = "o.j.gurney-champion@amsterdamumc.nl"},
]
dependencies = [
"numpy",
"scipy",
"numpy>=2,<3",
"scipy>=1.13",
"nibabel",
"torch",
"torchio",
"torch>=2.2,<3",
"torchio>=1.2,<2",
"joblib",
"dipy",
"dipy>=1.12.1,<2",
"cvxpy",
"nlopt",
"tqdm",
"pandas",
"pandas>=2.2,<4",
"statsmodels",
"ivimnet",
"super-ivim-dc>1.0.0",
Expand All @@ -40,6 +40,7 @@ dependencies = [
[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
"pytest-json-report",
]
docs = [
Expand All @@ -50,8 +51,13 @@ plot = [
"matplotlib",
"scienceplots",
]
preproc = [
"nipype",
"itk",
"pyyaml",
]
all = [
"osipi-ivim[test,docs,plot]",
"osipi-ivim[test,docs,plot,preproc]",
]

[project.urls]
Expand Down
Loading
Loading