Skip to content

Commit d72a3d8

Browse files
committed
Tooling
1 parent c555981 commit d72a3d8

File tree

7 files changed

+114
-4
lines changed

7 files changed

+114
-4
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
8+
9+
jobs:
10+
release-build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.12"
19+
20+
- name: build release distributions
21+
run: |
22+
python -m pip install pdm
23+
pdm build
24+
25+
- name: upload windows dists
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: release-dists
29+
path: dist/
30+
31+
pypi-publish:
32+
runs-on: ubuntu-latest
33+
needs:
34+
- release-build
35+
permissions:
36+
id-token: write
37+
38+
steps:
39+
- name: Retrieve release distributions
40+
uses: actions/download-artifact@v4
41+
with:
42+
name: release-dists
43+
path: dist/
44+
45+
- name: Publish release distributions to PyPI
46+
uses: pypa/gh-action-pypi-publish@release/v1
47+

.github/workflows/run_tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Run tests
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest, windows-latest]
18+
python-version: [3.12]
19+
20+
steps:
21+
22+
- name: checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v2
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install pdm
31+
run: pip install pdm
32+
33+
- name: pre-commit checks
34+
uses: pre-commit/action@v2.0.3
35+
36+
- name: Run tests
37+
run: |
38+
pdm install --dev
39+
pdm run pytest tests --cov=src
40+
41+
- name: Upload coverage reports to Codecov
42+
uses: codecov/codecov-action@v3
43+

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/astral-sh/ruff-pre-commit
9+
# Ruff version.
10+
rev: v0.6.0
11+
hooks:
12+
# Run the linter.
13+
- id: ruff
14+
# Run the formatter.
15+
- id: ruff-format
16+

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# grapevine
22

3-
JAX/Blackjax implementation of the grapevine method for reusing the solutions of guessing problems embedded in Hamiltonian trajectories.
3+
JAX/Blackjax implementation of the grapevine method for reusing the solutions of guessing problems embedded in Hamiltonian trajectories.
44

5-
The grapevine method can dramatically speed up MCMC for statistical with embedded equation solving problems.
5+
The grapevine method can dramatically speed up MCMC for statistical with embedded equation solving problems.
66

77
## Installation
88

benchmarks/optimistix_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""An example comparing GrapeNUTS and NUTS on a representative problem.
22
3-
This is supposed to be a complete example, mirroring how the grapevine method is used in practice.
3+
This is supposed to be a complete example, mirroring how the grapevine method is used in practice.
44
55
66
"""

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "grapevine"
2+
name = "grapevine-mcmc"
33
version = "0.1.0"
44
description = "Faster Hamiltonian trajectories for problems with guesses, using Blackjax"
55
authors = [
@@ -33,3 +33,6 @@ dev = [
3333
]
3434
[tool.hatch.metadata]
3535
allow-direct-references = true
36+
37+
[tool.hatch.build.targets.wheel]
38+
packages = ["src/grapevine"]

tests/simple_example_problem.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Simple example problems for other tests to use."""
2+
23
from functools import partial
34

45
from jax.scipy.special import expit

0 commit comments

Comments
 (0)