benchmarks: add 2KJR NOE+shift Cartesian refinement benchmark #44
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: Tests | |
| on: | |
| push: | |
| branches: ["master", "main"] | |
| pull_request: | |
| branches: ["master", "main"] | |
| permissions: | |
| contents: read | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| numpy-version: ["1.26.4", "2.2.6", "2.3.5"] | |
| jax-version: ["0.4.20", "latest"] | |
| exclude: | |
| - python-version: "3.11" | |
| numpy-version: "2.2.6" | |
| - python-version: "3.11" | |
| numpy-version: "2.3.5" | |
| - python-version: "3.12" | |
| numpy-version: "2.2.6" | |
| - python-version: "3.12" | |
| numpy-version: "2.3.5" | |
| - python-version: "3.13" | |
| numpy-version: "1.26.4" | |
| - python-version: "3.14" | |
| numpy-version: "1.26.4" | |
| - python-version: "3.13" | |
| jax-version: "0.4.20" | |
| - python-version: "3.14" | |
| jax-version: "0.4.20" | |
| - os: windows-latest | |
| python-version: '3.14' | |
| - jax-version: "0.4.20" | |
| numpy-version: "2.2.6" | |
| - jax-version: "0.4.20" | |
| numpy-version: "2.3.5" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install "numpy==${{ matrix.numpy-version }}" | |
| if [ "${{ matrix.jax-version }}" != "latest" ]; then | |
| pip install "jax==${{ matrix.jax-version }}" "jaxlib==${{ matrix.jax-version }}" | |
| fi | |
| pip install -e ".[dev,torch]" | |
| shell: bash | |
| - name: Ensure Hugging Face cache directory exists | |
| run: mkdir -p ~/.cache/huggingface | |
| shell: bash | |
| - name: Cache Hugging Face models | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/huggingface | |
| key: ${{ runner.os }}-huggingface-${{ hashFiles('**/pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-huggingface- | |
| - name: Check typing with mypy | |
| run: | | |
| mypy diff_integrator/ | |
| - name: Lint with ruff | |
| run: | | |
| ruff check diff_integrator/ | |
| - name: Run tests | |
| run: | | |
| pytest -v --cov=diff_integrator --cov-report=xml | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.xml | |
| fail_ci_if_error: false |