From 516124bb7bfd41ef99446eca4ff204446d0c15ae Mon Sep 17 00:00:00 2001 From: AntoineTheb Date: Wed, 27 Mar 2024 10:24:03 +0000 Subject: [PATCH] ENH: final prerelease --- .github/workflows/pythonpackage.yml | 45 +++++++++++++++++++++++++++++ README.md | 8 ++--- tests/test_runners.py | 6 ++++ 3 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/pythonpackage.yml create mode 100644 tests/test_runners.py diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml new file mode 100644 index 0000000..c184249 --- /dev/null +++ b/.github/workflows/pythonpackage.yml @@ -0,0 +1,45 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + python-version: ['3.10'] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install --user wheel + pip install --user packaging + ./install.sh + - name: Lint with flake8 + run: | + python -m pip install --upgrade pip + pip install --user wheel + python3 -m pip install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + python3 -m pip install pytest pytest-console-scripts + python3 -m pytest . diff --git a/README.md b/README.md index f841581..ceee2d0 100644 --- a/README.md +++ b/README.md @@ -51,19 +51,19 @@ Streamlines will be colored according to their predicted scores (if saving a `.t TractOracle-Net is available through Docker Hub. You can pull the image by running ``` -docker pull TODO +docker pull scilus/tractoracle-net:v2024b ``` You can then score a tractogram by running ``` -sudo docker run -v .:/workspace/${TRACTOGRAM_LOCATION} tractoracle-net predictor.py /workspace/${TRACTOGRAM_FILE} ${OUT} [...] +sudo docker run -v .:/workspace/${TRACTOGRAM_LOCATION} scilus/tractoracle-net:v2024b predictor.py /workspace/${TRACTOGRAM_FILE} ${OUT} [...] ``` See [Docker volumes](https://docs.docker.com/storage/volumes/) for an explanation of the `-v` flag. **To use CUDA capabilities with Docker, you will need to install the [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html)**. You will then be able to use the `--gpus` flag. For example: ``` -sudo docker run --gpus all -v .:/workspace/${TRACTOGRAM_LOCATION} tractoracle-net predictor.py /workspace/${TRACTOGRAM_FILE} ${OUT} [...] +sudo docker run --gpus all -v .:/workspace/${TRACTOGRAM_LOCATION} scilus/tractoracle-net:v2024b predictor.py /workspace/${TRACTOGRAM_FILE} ${OUT} [...] ``` ## Training @@ -120,6 +120,6 @@ options: ## References -See preprint: COMING SOON +See preprint: https://arxiv.org/abs/2403.17845 See conference paper: (hopefully) COMING SOON diff --git a/tests/test_runners.py b/tests/test_runners.py new file mode 100644 index 0000000..62a0348 --- /dev/null +++ b/tests/test_runners.py @@ -0,0 +1,6 @@ +def test_ttl_track(script_runner): + # Call 'ttl_track.py' from the command line and assert that it + # runs without errors + + ret = script_runner.run('predictor.py', '--help') + assert ret.success