Skip to content

rm test train inference config_optimizier + modif test.yml #720

rm test train inference config_optimizier + modif test.yml

rm test train inference config_optimizier + modif test.yml #720

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get python version from env.yaml
id: python_version
run: echo PYTHON_VERS=$(cat env.yaml | grep python= | sed 's/.*python=\([0-9]\.[0-9]*\.[0-9]*\).*/\1/') >> $GITHUB_OUTPUT
- name: Set up Python ${{ steps.python_version.outputs.PYTHON_VERS }}
uses: actions/setup-python@v3
with:
python-version: "${{ steps.python_version.outputs.PYTHON_VERS }}"
- name: Get pytorch version from env.yaml
id: pytorch_version
run: echo PYTORCH_VERS=$(cat env.yaml | grep torch== | sed 's/.*torch==\(.*\)/\1/') >> $GITHUB_OUTPUT
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt \
torch==${{ steps.pytorch_version.outputs.PYTORCH_VERS }}
pip install -r requirements_lint.txt
pip install --editable .
- name: Lint
run: |
./lint.sh .
- name: Integration Test with pytest
run: |
export PY4CAST_ROOTDIR=`pwd`
coverage run -p -m pytest tests/
coverage run -p bin/main.py fit --config config/CLI/trainer.yaml --config config/CLI/dataset/dummy.yaml --config config/CLI/model/unetrpp.yaml --trainer.fast_dev_run True
coverage run -p bin/main.py fit --config config/CLI/trainer.yaml --config config/CLI/dataset/dummy.yaml --config config/CLI/model/unetrpp.yaml --trainer.max_epochs 1 --data.batch_size 1 --trainer.limit_train_batches 1 --trainer.logger.version version_test
coverage run -p bin/main.py fit --config config/CLI/trainer.yaml --config config/CLI/dataset/dummy.yaml --config config/CLI/model/unetrpp.yaml --trainer.max_epochs 1 --data.batch_size 1 --trainer.limit_train_batches 1 --ckpt_path /home/runner/work/py4cast/py4cast/lightning_logs/version_test/checkpoints/last.ckpt
coverage run -p bin/main.py test --config config/CLI/trainer.yaml --config config/CLI/dataset/dummy.yaml --config config/CLI/model/unetrpp.yaml --trainer.max_epochs 1 --data.batch_size 1 --trainer.limit_train_batches 1 --ckpt_path /home/runner/work/py4cast/py4cast/lightning_logs/version_test/checkpoints/last.ckpt
coverage run -p bin/main.py predict --config config/CLI/trainer.yaml --config config/CLI/dataset/dummy.yaml --config config/CLI/model/unetrpp.yaml --trainer.max_epochs 1 --data.batch_size 1 --trainer.limit_train_batches 1 --ckpt_path /home/runner/work/py4cast/py4cast/lightning_logs/version_test/checkpoints/last.ckpt
coverage combine
coverage report --ignore-errors --fail-under=60