Skip to content

Commit 0c0ed47

Browse files
Merge main and align python layout
2 parents 8dee52e + 7acf58e commit 0c0ed47

34 files changed

Lines changed: 1639 additions & 50 deletions

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main, feat/* ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v4
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
run: uv python install ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: uv sync --dev
27+
28+
- name: Run tests with coverage
29+
run: uv run pytest --verbose --cov=bpdecoderplus --cov-report=xml --cov-report=term
30+
31+
- name: Upload coverage to Codecov
32+
uses: codecov/codecov-action@v4
33+
with:
34+
token: ${{ secrets.CODECOV_TOKEN }}
35+
files: ./coverage.xml
36+
flags: unittests
37+
name: codecov-umbrella
38+
fail_ci_if_error: false

.gitignore

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
1-
__pycache__/
2-
*.pyc
1+
# macOS
32
.DS_Store
3+
4+
# Jupyter
45
.ipynb_checkpoints/
6+
7+
# Julia
58
Manifest.toml
9+
10+
# IDE
611
.vscode/
12+
.idea/
13+
14+
# Python
15+
.venv/
16+
__pycache__/
17+
*.py[cod]
18+
*$py.class
19+
*.egg-info/
20+
dist/
21+
build/
22+
.eggs/
23+
*.egg
24+
.pytest_cache/
25+
.coverage
26+
coverage.xml
27+
htmlcov/
28+
.uv/
29+
uv.lock
30+
31+
# LaTeX
732
*.aux
833
*.fls
934
*.log

Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.PHONY: help install setup test test-cov generate-dataset clean
2+
3+
help:
4+
@echo "Available targets:"
5+
@echo " install - Install uv package manager"
6+
@echo " setup - Set up development environment with uv"
7+
@echo " generate-dataset - Generate noisy circuit dataset"
8+
@echo " test - Run tests"
9+
@echo " test-cov - Run tests with coverage report"
10+
@echo " clean - Remove generated files and caches"
11+
12+
install:
13+
@command -v uv >/dev/null 2>&1 || { \
14+
echo "Installing uv..."; \
15+
curl -LsSf https://astral.sh/uv/install.sh | sh; \
16+
}
17+
18+
setup: install
19+
uv sync --dev
20+
21+
generate-dataset:
22+
uv run generate-noisy-circuits --distance 3 --p 0.01 --rounds 3 5 7 --task z --output datasets/noisy_circuits
23+
24+
test:
25+
uv run pytest
26+
27+
test-cov:
28+
uv run pytest --cov=bpdecoderplus --cov-report=html --cov-report=term
29+
30+
clean:
31+
rm -rf .pytest_cache
32+
rm -rf __pycache__
33+
rm -rf htmlcov
34+
rm -rf .coverage
35+
rm -rf coverage.xml
36+
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
37+
find . -type f -name "*.pyc" -delete

0 commit comments

Comments
 (0)