Update README.md #7
This file contains hidden or 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
| name: Run ScAPE Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' # speeds up installs | |
| - name: Install package | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . | |
| # remove the _data directory if it exists from previous runs | |
| - name: Clean previous data | |
| run: rm -rf _data | |
| - name: Run test code | |
| shell: bash | |
| run: | | |
| python - <<'PY' | |
| import matplotlib | |
| matplotlib.use('Agg') # headless for CI | |
| import matplotlib.pyplot as plt | |
| import scape | |
| # download data (cached in subsequent runs) | |
| scape.io.download_from_zenodo(target_dir='.') | |
| # train | |
| result = scape.api.train( | |
| de_file='_data/de_train.parquet', | |
| lfc_file='_data/lfc_train.parquet', | |
| cv_drug='Belinostat', | |
| n_genes=64 | |
| ) | |
| # plot and save so CI has an artifact, not a GUI | |
| scape.util.plot_result(result._last_train_results) | |
| plt.tight_layout() | |
| plt.savefig('results.png', dpi=150) | |
| PY | |
| - name: Upload results | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: scape-results | |
| path: results.png |