Skip to content

update config, setup, nn_tools for keras 3.0 and torch #244

update config, setup, nn_tools for keras 3.0 and torch

update config, setup, nn_tools for keras 3.0 and torch #244

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
env:
SDSS_LOCAL_SAS_MIRROR: ./ci_data/
GAIA_TOOLS_DATA: ./ci_data/
LASMOT_DR5_DATA: ./ci_data/
strategy:
fail-fast: false
matrix:
include:
- { TORCH_VER: 2.1.0, PAPER_MODELS: true, ALLOW_FAILURE: false }
- { TORCH_VER: 2.1.0, PAPER_MODELS: false, ALLOW_FAILURE: false }
- { TORCH_VER: 2.0.0, PAPER_MODELS: true, ALLOW_FAILURE: false }
- { TORCH_VER: 2.0.0, PAPER_MODELS: false, ALLOW_FAILURE: false }
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install torch~=${{ matrix.TORCH_VER }}
pip install --upgrade "keras>=3.0"
pip install coveralls pydot graphviz pytest pytest-cov
pip install .
python -c "from astroNN.config import tf_patch; tf_patch()"
- name: Cache test data
uses: actions/cache@v3
with:
path: ${{github.workspace}}/ci_data/
key: astronn-${{ runner.os }}-${{ matrix.TORCH_VER }}-${{ matrix.PAPER_MODELS }}-2023april30
- name: Test astroNN
continue-on-error: ${{ matrix.ALLOW_FAILURE }}
if: ${{ matrix.PAPER_MODELS == false}}
# Run almost all tests for latest config
run: >
python -m pytest --cov astroNN --cov-report=xml tests/test_numpy_tools.py tests/test_loss_func.py
tests/test_layers.py tests/test_apogee_tools.py tests/test_datasets.py tests/test_gaia_tools.py
tests/test_lamost_tools.py tests/test_models.py tests/test_utilities.py tests/test_neuralODE.py
--disable-pytest-warnings
# Run papers models test
- name: Test paper models
continue-on-error: ${{ matrix.ALLOW_FAILURE }}
if: ${{ matrix.PAPER_MODELS == true}}
run: >
python -m pytest --cov astroNN --cov-report=xml tests/test_apogee_model.py tests/test_paper_models.py
--disable-pytest-warnings
- name: Upload coverage reports to Codecov
continue-on-error: ${{ matrix.ALLOW_FAILURE }}
uses: codecov/codecov-action@v3
env:
TORCH_VER: ${{ matrix.TORCH_VER }}
PAPER_MODELS: ${{ matrix.PAPER_MODELS }}
with:
flags: unittests
env_vars: TORCH_VER, PAPER_MODELS
name: codecov-astroNN
fail_ci_if_error: true
verbose: true