Skip to content

Commit

Permalink
Merge branch 'debug_integral' into dp/laplace
Browse files Browse the repository at this point in the history
  • Loading branch information
unalmis committed Jan 17, 2025
2 parents bc95043 + 2ea5eaf commit 7f8a2ea
Show file tree
Hide file tree
Showing 139 changed files with 143,554 additions and 143,424 deletions.
35 changes: 35 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,38 @@ updates:
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
groups:
# group similar dependencies together into fewer PRs
docs:
patterns:
- "sphinx"
linting:
patterns:
- "flake8"
- "black"
- "pre-commit"
testing:
patterns:
- "pytest"
- "qic"
- "qsc"
- "shapely"
minor_packages:
patterns:
- "colorama"
- "nvgpu"
- "psutil"
- "pylatexenc"
- "termcolor"
jax:
patterns:
- "jax"
- "diffrax"
- "interpax"
- "orthax"
- "quadax"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
31 changes: 19 additions & 12 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,35 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Check full Python version
run: |
python --version
python_version=$(python --version 2>&1 | cut -d' ' -f2)
echo "Python version: $python_version"
echo "version=$python_version" >> $GITHUB_ENV
- name: Restore Python environment cache
if: env.has_changes == 'true'
id: restore-env
uses: actions/cache/restore@v4
with:
path: .venv-${{ matrix.python-version }}
key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }}
path: .venv-${{ env.version }}
key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }}

- name: Set up virtual environment if not restored from cache
if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true'
run: |
gh cache list
python -m venv .venv-${{ matrix.python-version }}
source .venv-${{ matrix.python-version }}/bin/activate
python -m venv .venv-${{ env.version }}
source .venv-${{ env.version }}/bin/activate
python -m pip install --upgrade pip
pip install -r devtools/dev-requirements.txt
pip install matplotlib==3.9.2
- name: Benchmark with pytest-benchmark (PR)
if: env.has_changes == 'true'
run: |
source .venv-${{ matrix.python-version }}/bin/activate
source .venv-${{ env.version }}/bin/activate
pwd
lscpu
pip list
Expand All @@ -106,7 +113,7 @@ jobs:
- name: Benchmark with pytest-benchmark (MASTER)
if: env.has_changes == 'true'
run: |
source .venv-${{ matrix.python-version }}/bin/activate
source .venv-${{ env.version }}/bin/activate
pwd
lscpu
pip list
Expand All @@ -122,7 +129,7 @@ jobs:
- name: Put benchmark results in same folder
if: env.has_changes == 'true'
run: |
source .venv-${{ matrix.python-version }}/bin/activate
source .venv-${{ env.version }}/bin/activate
pwd
cd tests/benchmarks
find .benchmarks/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2- | tail -n 1 > temp1
Expand All @@ -143,20 +150,20 @@ jobs:
- name: Compare latest commit results to the master branch results
if: env.has_changes == 'true'
run: |
source .venv-${{ matrix.python-version }}/bin/activate
source .venv-${{ env.version }}/bin/activate
cd tests/benchmarks
pwd
python compare_bench_results.py
cat commit_msg.txt
- name: Comment PR with the results
if: env.has_changes == 'true'
uses: thollander/actions-comment-pull-request@v2
uses: thollander/actions-comment-pull-request@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
with:
filePath: tests/benchmarks/commit_msg.txt
comment_tag: benchmark
file-path: tests/benchmarks/commit_msg.txt
comment-tag: benchmark

- name: Upload benchmark data
if: always() && env.has_changes == 'true'
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,32 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Check full Python version
run: |
python --version
python_version=$(python --version 2>&1 | cut -d' ' -f2)
echo "Python version: $python_version"
echo "version=$python_version" >> $GITHUB_ENV
- name: Restore Python environment cache
id: restore-env
uses: actions/cache/restore@v4
with:
path: .venv-${{ matrix.python-version }}
key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }}
path: .venv-${{ env.version }}
key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }}

- name: Set up virtual environment if not restored from cache
if: steps.restore-env.outputs.cache-hit != 'true'
run: |
gh cache list
python -m venv .venv-${{ matrix.python-version }}
source .venv-${{ matrix.python-version }}/bin/activate
python -m venv .venv-${{ env.version }}
source .venv-${{ env.version }}/bin/activate
python -m pip install --upgrade pip
pip install -r devtools/dev-requirements.txt
- name: Check files using the black formatter
run: |
source .venv-${{ matrix.python-version }}/bin/activate
source .venv-${{ env.version }}/bin/activate
black --version
black --check desc/ tests/ || black_return_code=$?
echo "BLACK_RETURN_CODE=$black_return_code" >> $GITHUB_ENV
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/cache_dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,28 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Check full Python version
run: |
python --version
python_version=$(python --version 2>&1 | cut -d' ' -f2)
echo "Python version: $python_version"
echo "version=$python_version" >> $GITHUB_ENV
- name: Delete old cached file with same python version
run: |
echo "Current Cached files list"
gh cache list
echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ matrix.python-version }}-"
for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ matrix.python-version }}-\")) | .key"); do
echo "Deleting cached files with pattern: ${{ runner.os }}-venv-${{ env.version }}-"
for cache_key in $(gh cache list --json key -q ".[] | select(.key | startswith(\"${{ runner.os }}-venv-${{ env.version }}-\")) | .key"); do
echo "Deleting cache with key: $cache_key"
gh cache delete "$cache_key"
done
# Update the matplotlib version if needed later
- name: Set up virtual environment
run: |
python -m venv .venv-${{ matrix.python-version }}
source .venv-${{ matrix.python-version }}/bin/activate
python -m venv .venv-${{ env.version }}
source .venv-${{ env.version }}/bin/activate
python -m pip install --upgrade pip
pip install -r devtools/dev-requirements.txt
pip install matplotlib==3.9.2
Expand All @@ -47,12 +54,13 @@ jobs:
id: cache-env
uses: actions/cache@v4
with:
path: .venv-${{ matrix.python-version }}
key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }}
path: .venv-${{ env.version }}
key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }}

- name: Verify virtual environment activation
run: |
source .venv-${{ matrix.python-version }}/bin/activate
source .venv-${{ env.version }}/bin/activate
which python
python --version
pip --version
pip list
4 changes: 2 additions & 2 deletions .github/workflows/jax_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ jobs:
jax-version: [0.4.12, 0.4.13, 0.4.14, 0.4.16, 0.4.17,
0.4.18, 0.4.19, 0.4.20, 0.4.21, 0.4.22, 0.4.23,
0.4.24, 0.4.25, 0.4.26, 0.4.27, 0.4.28, 0.4.29,
0.4.30, 0.4.31, 0.4.33, 0.4.34, 0.4.35]
0.4.30, 0.4.31, 0.4.33, 0.4.34, 0.4.35, 0.4.37]
# 0.4.32 is not available on PyPI
# earlier jax versions are not compatible with other
# dependencies as of 2024-10-04
# 0.4.36 has a bug that causes tests to fail
group: [1, 2]
steps:
- uses: actions/checkout@v4
Expand All @@ -44,7 +45,6 @@ jobs:
run: |
pwd
lscpu
pip list
python -m pytest -m unit \
--durations=0 \
--mpl \
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/notebook_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,28 +51,35 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Check full Python version
run: |
python --version
python_version=$(python --version 2>&1 | cut -d' ' -f2)
echo "Python version: $python_version"
echo "version=$python_version" >> $GITHUB_ENV
- name: Restore Python environment cache
if: env.has_changes == 'true'
id: restore-env
uses: actions/cache/restore@v4
with:
path: .venv-${{ matrix.python-version }}
key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }}
path: .venv-${{ env.version }}
key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }}

- name: Set up virtual environment if not restored from cache
if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true'
run: |
gh cache list
python -m venv .venv-${{ matrix.python-version }}
source .venv-${{ matrix.python-version }}/bin/activate
python -m venv .venv-${{ env.version }}
source .venv-${{ env.version }}/bin/activate
python -m pip install --upgrade pip
pip install -r devtools/dev-requirements.txt
pip install matplotlib==3.9.2
- name: Test notebooks with pytest and nbmake
if: env.has_changes == 'true'
run: |
source .venv-${{ matrix.python-version }}/bin/activate
source .venv-${{ env.version }}/bin/activate
pwd
lscpu
pip list
Expand Down
32 changes: 17 additions & 15 deletions .github/workflows/regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,27 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Check full Python version
run: |
python --version
python_version=$(python --version 2>&1 | cut -d' ' -f2)
echo "Python version: $python_version"
echo "version=$python_version" >> $GITHUB_ENV
- name: Restore Python environment cache
if: env.has_changes == 'true'
id: restore-env
uses: actions/cache/restore@v4
with:
path: .venv-${{ matrix.python-version }}
key: ${{ runner.os }}-venv-${{ matrix.python-version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }}
path: .venv-${{ env.version }}
key: ${{ runner.os }}-venv-${{ env.version }}-${{ hashFiles('devtools/dev-requirements.txt', 'requirements.txt') }}

- name: Set up virtual environment if not restored from cache
if: steps.restore-env.outputs.cache-hit != 'true' && env.has_changes == 'true'
run: |
gh cache list
python -m venv .venv-${{ matrix.python-version }}
source .venv-${{ matrix.python-version }}/bin/activate
python -m venv .venv-${{ env.version }}
source .venv-${{ env.version }}/bin/activate
python -m pip install --upgrade pip
pip install -r devtools/dev-requirements.txt
pip install matplotlib==3.9.2
Expand All @@ -77,7 +84,7 @@ jobs:
- name: Test with pytest
if: env.has_changes == 'true'
run: |
source .venv-${{ matrix.python-version }}/bin/activate
source .venv-${{ env.version }}/bin/activate
pwd
lscpu
pip list
Expand Down Expand Up @@ -107,14 +114,9 @@ jobs:
- name: Upload coverage
if: env.has_changes == 'true'
id : codecov
uses: Wandalen/wretry.action@v3.5.0
uses: codecov/codecov-action@v5
with:
action: codecov/codecov-action@v4
with: |
token: ${{ secrets.CODECOV_TOKEN }}
name: codecov-umbrella
files: ./cov.xml
fail_ci_if_error: true
verbose: true
attempt_limit: 10
attempt_delay: 60000 # ms, 1 min
name: codecov-umbrella
files: ./cov.xml
fail_ci_if_error: true
verbose: true
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Build package
run: python -m build --sdist --wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Loading

0 comments on commit 7f8a2ea

Please sign in to comment.