-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
123 lines (112 loc) · 3.42 KB
/
Copy pathpyproject.toml
File metadata and controls
123 lines (112 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
[project]
name = "weave"
version = "0.3.0-alpha"
description = "A geometry-aware compiler for CSS syndrome extraction with correlated noise from routed embeddings."
authors = [
{ name = "angelo", email = "angelo.dibella2020@gmail.com" }
]
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.10, <3.14"
dependencies = [
"numpy >=2.0.0",
"matplotlib >=3.9.2",
"sinter >=1.14.0",
"stimbposd >=0.0.1",
"stim >=1.14.0",
"networkx >=3.4.2",
]
[project.optional-dependencies]
gui = ["pyside6 >=6.8"]
notebooks = ["notebook >=7.2.2"]
dev = [
"weave[gui]",
"pytest >=8.3.4",
"pytest-cov >=5.0.0",
"ruff >=0.9.0",
"mypy >=1.13.0",
"pre-commit >=4.0.0",
]
[project.scripts]
wv = "weave.gui.editor:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
# ---------------------------------------------------------------------------
# Tool configuration
# ---------------------------------------------------------------------------
[tool.ruff]
target-version = "py310"
line-length = 100
src = ["weave"]
extend-exclude = ["examples", "private", "benchmarks"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"N", # pep8-naming
]
ignore = [
"E501", # line length handled by formatter, not linter
"N803", # allow uppercase argument names (HX, HZ, H1, H2 are standard in QEC)
"N806", # allow uppercase local names (same reason)
"B008", # allow function calls in default arguments (dataclasses pattern)
]
[tool.ruff.lint.per-file-ignores]
# Qt event handlers (paintEvent, mousePressEvent, etc.) must keep camelCase
# because they override PySide6 methods. SIM* rules are style preferences the
# GUI module has not been tuned for yet.
"weave/gui/*" = ["N802", "SIM102", "SIM108", "SIM116", "E741"]
# Tests commonly use single-letter math names (I for identity, l for list).
"weave/tests/*" = ["N802", "E741"]
# BB code module uses math-convention names: `l`, `m` for the Z_l×Z_m
# cyclic factors, and functions like `ker_A_basis` that encode the
# symbol `A` from the paper's polynomial notation.
"weave/codes/bb/*" = ["N802", "E741"]
# BB embeddings share the same `l, m` naming for BB parameters.
"weave/ir/embeddings/column.py" = ["E741"]
"weave/ir/embeddings/biplanar.py" = ["E741"]
# BB benchmarks reuse the same math-convention naming.
"benchmarks/regression/bb72.py" = ["N802", "E741"]
[tool.mypy]
python_version = "3.10"
warn_unused_configs = true
warn_return_any = true
warn_unused_ignores = true
files = [
"weave/codes",
"weave/util",
"weave/surface",
"weave/geometry",
"weave/ir",
"weave/compiler",
"weave/analysis",
]
ignore_missing_imports = true # stim, stimbposd, sinter, pymatching have no stubs
# GUI module is intentionally excluded from `files` until PySide6 typing
# stabilizes; re-add when the IR module lands and GUI consumes typed objects.
[tool.pytest.ini_options]
testpaths = ["weave/tests"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
]
[tool.coverage.run]
source = ["weave"]
omit = [
"weave/tests/*",
"weave/gui/*", # GUI coverage measured separately when relevant
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]