Improved evaluation handling for pytorch data. #484
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# codecov recommends calculating coverage on all configurations and submitting with flags | |
# here https://community.codecov.com/t/upload-of-coverage-of-several-python-versions/2349/2 | |
#dependency caching does not appear to be working currently. All install steps take the same amount of time with and without dependency cahcing. | |
name: unit_and_example_tests_with_code_coverage | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# macos-latest took at least 20 minutes to complete so I've removed it for now | |
# windows-latest took about 1:30 minutes longer than ubuntu so I've removed it for now | |
os: [ubuntu-latest] | |
python: ['3.8.x', '3.9.x', '3.10.x'] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
cache: 'pip' | |
cache-dependency-path: | | |
coba/tests/requirements-soft.txt | |
coba/tests/requirements-test.txt | |
- run: python --version | |
- name: Min Dependency Installs | |
run: | | |
pip install . | |
pip list | |
- name: Min Dependency Unit Tests | |
run: python -m unittest | |
- name: Max Dependency Installs | |
run: | | |
pip install .[full] | |
pip install -r coba/tests/requirements-test.txt | |
pip list | |
- name: Max Dependency Unit Tests with Coverage | |
run: | | |
coverage run -m unittest | |
coverage xml | |
- name: Report Coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: unittest, ${{ matrix.os }}, ${{ matrix.version }} | |
- name: Example Tests | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
python -c "from coba.environments import Environments; Environments.from_template('./examples/templates/long_experiment.json')" | |
python -c "from coba.environments import Environments; Environments.from_template('./examples/templates/short_experiment.json')" | |
python "examples/scripts/Quickstart.py" | |
python "examples/scripts/custom_namespaces_vw_learner.py" | |
python "examples/scripts/online_and_offline.py" | |
jupyter nbconvert --execute "examples/notebooks/Quickstart.ipynb" --inplace | |
jupyter nbconvert --execute "examples/notebooks/Results.ipynb" --inplace | |
jupyter nbconvert --execute "examples/notebooks/Experiments.ipynb" --inplace | |
jupyter nbconvert --execute "examples/notebooks/Environments.ipynb" --inplace |