Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 12 additions & 30 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,57 +8,39 @@ on:

jobs:
precommit:
name: Pre-commit checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0

build:
runs-on: ubuntu-latest
needs:
- precommit
strategy:
matrix:
python-version: [ 3.12 ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install hatch
- name: Build package
run: |
hatch build

lints:
runs-on: ubuntu-latest
needs:
- precommit
strategy:
matrix:
python-version: [ 3.12 ]
python-version: [ 3.12, 3.13 ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Install dependencies
run: |
pip install hatch
uv sync --all-groups
- name: Run lints
run: |
hatch run test:lint
make lints

tests:
runs-on: ubuntu-latest
needs:
- precommit
- lints
strategy:
matrix:
python-version: [ 3.12, 3.13 ]
Expand All @@ -68,15 +50,15 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Install dependencies
run: |
pip install hatch
- name: Build package
run: |
pip install jaxlib jax
uv sync
- name: Run tests
run: |
hatch run test:test
make tests
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- uses: astral-sh/setup-uv@v5
with:
version: "latest"
- name: Install dependencies
run: |
pip install hatch matplotlib
- name: Build package
run: |
pip install jaxlib jax
pip install .
uv sync --all-groups
- name: Run tests
run: |
python examples/autoregressive_inference_surjection.py --n-iter 10
python examples/conditional_density_estimation.py --n-iter 10 --model coupling
python examples/conditional_density_estimation.py --n-iter 10 --model autoregressive
python examples/coupling_inference_surjection.py --n-iter 10
uv run python examples/autoregressive_inference_surjection.py --n-iter 10
uv run python examples/conditional_density_estimation.py --n-iter 10 --model coupling
uv run python examples/conditional_density_estimation.py --n-iter 10 --model autoregressive
uv run python examples/coupling_inference_surjection.py --n-iter 10
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.12, 3.13]
python-version: [3.12]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,6 @@ In order to contribute:
6) Test it by calling `make tests`, `make lints` and `make format` on the (Unix) command line.
7) Submit a PR 🙂.

```shell
pre-commit install
gitlint install-hook
```
6) Implement your contribution and ideally a test case.
7) Test it by calling `make format`, `make lints` and `make tests` on the (Unix) command line.
8) Submit a PR 🙂.

## Citing Surjectors

If you find our work relevant to your research, please consider citing:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ show_error_codes = true
no_implicit_optional = true

[tool.pytest.ini_options]
addopts = ["-v", "--doctest-modules", "--cov=./surjectors", "--cov-report=xml"]
addopts = ["-v", "--cov=./surjectors", "--cov-report=xml"]
testpaths = [
"surjectors"
]
Expand Down
Loading