Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
286 lines (258 loc) · 9.91 KB
/
Copy pathpyproject.toml
File metadata and controls
286 lines (258 loc) · 9.91 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
[build-system]
requires = ["hatchling==1.32.4"]
build-backend = "hatchling.build"
[project]
name = "solarlab"
version = "0.1.0"
description = "SolarLab simulation platform and staged public package architecture"
requires-python = ">=3.11"
dependencies = [
# Keep the observed numerical environment on 3.12+, with a separately
# tested 3.11 branch instead of silently raising the supported minimum.
"numpy==2.3.5; python_version < '3.12'",
"numpy==2.5.3; python_version >= '3.12'",
"scipy==1.16.3; python_version < '3.12'",
"scipy==1.18.1; python_version >= '3.12'",
"pyyaml==6.0.3",
"matplotlib==3.11.2",
"threadpoolctl==3.6.0",
# Strict editable configuration DTOs are part of the new core package.
"pydantic==2.13.5",
]
[project.optional-dependencies]
server = ["fastapi==0.141.1", "uvicorn==0.52.4", "pydantic==2.13.5"]
# Import support for the existing optional Celery entry point. Broker/worker
# execution is separate from the in-process JobRegistry used by the API.
queue = ["celery[redis]==5.5.3"]
research = ["openpyxl>=3.1", "pymupdf>=1.24"]
ida = ["scikit-sundae==1.1.3"]
# Optional rigorous Arb observer arithmetic; installed explicitly in core CI.
arb = ["python-flint==0.8.0"]
dev = [
"pytest==9.1.1",
"pytest-cov==7.1.0",
"httpx==0.28.1",
"jsonschema==4.26.0",
"ruff>=0.15.20",
"mypy>=1.18",
"import-linter>=2.5",
]
notebook = ["jupyterlab>=4.0"]
[project.scripts]
solarlab = "solarlab.cli:main"
solarlab-server = "solarlab.cli:server_main"
solarlab-cbo-scan = "solarlab_research.scripts.cbo_scan:main"
solarlab-r1-short-window = "solarlab_research.scripts.r1_short_window:main"
solarlab-r1-verify-sources = "solarlab_research.scripts.r1_verify_sources:main"
[tool.uv]
# Preserve the observed transitive baseline as well as the direct pins above.
# contourpy 1.4 requires 3.12; uv selects a compatible release on Python 3.11.
constraint-dependencies = [
"annotated-doc==0.0.5",
"annotated-types==0.8.0",
"anyio==4.15.1",
"certifi==2026.7.22",
"click==8.5.0",
"contourpy==1.4.0; python_version >= '3.12'",
"coverage==7.16.0",
"cycler==0.12.1",
"fonttools==4.65.0",
"h11==0.16.0",
"httpcore==1.0.9",
"idna==3.19",
"iniconfig==2.3.0",
"kiwisolver==1.5.1",
"packaging==26.3",
"pillow==12.3.0",
"pluggy==1.6.0",
"pydantic-core==2.46.5",
"pygments==2.21.0",
"pyparsing==3.3.2",
"python-dateutil==2.9.0.post0",
"six==1.17.0",
"starlette==1.6.0",
"typing-extensions==4.16.0",
"typing-inspection==0.4.4",
]
# The pinned optional IDA wheel supports Python <3.15. This limits the
# reproducible lock, without changing the package's existing >=3.11 minimum.
environments = ["python_version < '3.15'"]
exclude-newer = "2026-10-05T08:33:47Z"
[tool.ruff]
target-version = "py311"
line-length = 88
[tool.ruff.lint]
select = ["E4", "E7", "E9", "F"]
[tool.mypy]
python_version = "3.11"
follow_imports = "skip"
ignore_missing_imports = true
check_untyped_defs = true
disallow_untyped_defs = true
# numpy==2.3.5 (locked for Python <3.12) types 1D np.interp as float64 and
# np.max as unparameterized; numpy==2.5.3 (Python >=3.12) types both cleanly.
[[tool.mypy.overrides]]
module = ["solarlab.device.compile_1d"]
disable_error_code = ["arg-type"]
[[tool.mypy.overrides]]
module = ["solarlab.experiments.degradation"]
disable_error_code = ["var-annotated"]
[tool.pytest.ini_options]
pythonpath = ["."]
testpaths = ["tests"]
addopts = "-ra -m 'not slow'"
markers = [
"slow: marks tests as slow (run with -m slow)",
"requires_clean_core: binds the running core to committed source; skips on changed bound Python files",
"platform_bound: consumes captured numeric fixtures; only frozen-output comparisons use the capture guard, portable metadata and live parity still run",
"frontend: Python/TypeScript client contracts executed by the frontend CI job",
"regression: physical-sanity regression tests (V_oc / J_sc / FF envelopes, parity gates)",
"validation: physics trend validation against literature windows (V_oc vs Eg, FF vs mobility, etc.)",
]
# Target P09-01 build: ship only first-party packages (solarlab,
# solarlab_research, solarlab_server) plus prebuilt web/dist SPA assets when
# present. Legacy perovskite-sim is excluded from both wheel and sdist.
[tool.hatch.build]
reproducible = true
exclude = ["**/__pycache__/**", "**/*.pyc", "**/*.pyo", "**/.DS_Store"]
[tool.hatch.build.targets.wheel]
only-include = [
"src/solarlab",
"src/solarlab_research",
"src/solarlab_server",
]
sources = ["src"]
[tool.hatch.build.targets.wheel.hooks.custom]
path = "src/solarlab/materials/wheel_hook.py"
[tool.hatch.build.targets.sdist]
only-include = [
".gitignore",
"pyproject.toml",
"uv.lock",
"examples/research_1d",
"examples/research_2d",
"tests/integration/test_research_1d_workflow.py",
"src/solarlab",
"src/solarlab_research",
"src/solarlab_server",
"tests/refactor/test_package_preparation.py",
"tests/refactor/test_configuration_preparation.py",
"tests/refactor/test_device_configuration_preparation.py",
"tests/refactor/test_complex_configuration_preparation.py",
"tests/refactor/test_structured_registry_preparation.py",
"tests/refactor/test_execution_identity_preparation.py",
"tests/refactor/test_execution_manifest.py",
"tests/refactor/test_release_bundle.py",
"tests/refactor/test_binding_identity.py",
"tests/refactor/test_jv_protocol_preparation.py",
"tests/refactor/test_sweep_preparation.py",
"tests/refactor/fixtures/jv_reference_requests.json",
"tests/refactor/test_behavior_context.py",
"tests/refactor/test_configuration_schema_export.py",
"tests/refactor/test_configuration_input_types.py",
"tests/refactor/test_package_boundaries.py",
"tests/refactor/test_experiment_registry_startup.py",
"tests/refactor/test_input_domain_closure.py",
"tests/refactor/test_configuration_migration.py",
"tests/refactor/fixtures/r1_common_state_preparation.json",
"tests/refactor/fixtures/r1_pair_common_state_preparation.json",
"tests/refactor/fixtures/r1_execution_policy.json",
"reproducibility/AnalyticGatesV1.json",
"reproducibility/ScapsComparisonContractV1.json",
"reproducibility/HysteresisReferenceContractV2.json",
"reproducibility/PerformanceCasesV1.json",
"scripts/generate_configuration_schema.py",
"web/src",
"web/tests",
"web/public",
"web/scripts",
"web/package.json",
"web/package-lock.json",
"web/index.html",
"web/tsconfig.json",
"web/vite.config.ts",
"web/vitest.config.ts",
"web/Dockerfile",
"web/.gitignore",
"tests/runtime/test_run_store.py",
"tests/runtime/test_execution.py",
"tests/runtime/execution_workers.py",
"tests/runtime/runtime_evidence.py",
"tests/runtime/test_event_service.py",
"tests/runtime/test_configuration_schema_service.py",
"tests/runtime/test_configuration_preview.py",
]
[tool.hatch.build.targets.sdist.hooks.custom]
path = "src/solarlab/materials/wheel_hook.py"
[tool.importlinter]
root_packages = ["solarlab", "solarlab_research", "solarlab_server"]
include_external_packages = true
[[tool.importlinter.contracts]]
name = "Core has no companion or legacy dependency"
type = "forbidden"
source_modules = ["solarlab"]
forbidden_modules = [
"solarlab_research", "solarlab_server", "perovskite_sim", "backend",
]
[[tool.importlinter.contracts]]
name = "Research package has no legacy dependency"
type = "forbidden"
source_modules = ["solarlab_research"]
forbidden_modules = ["perovskite_sim", "backend"]
[[tool.importlinter.contracts]]
name = "Server package has no legacy dependency"
type = "forbidden"
source_modules = ["solarlab_server"]
forbidden_modules = ["perovskite_sim", "backend"]
[[tool.importlinter.contracts]]
name = "Companion packages are independent"
type = "independence"
modules = ["solarlab_research", "solarlab_server"]
[[tool.importlinter.contracts]]
name = "Material data does not import higher configuration or device layers"
type = "forbidden"
source_modules = ["solarlab.materials"]
forbidden_modules = ["solarlab.config", "solarlab.device", "solarlab.physics", "solarlab.experiments"]
[[tool.importlinter.contracts]]
name = "Units do not depend on model or input data"
type = "forbidden"
source_modules = ["solarlab.units"]
forbidden_modules = ["solarlab.materials", "solarlab.config", "solarlab.device", "solarlab.physics", "solarlab.experiments"]
[[tool.importlinter.contracts]]
name = "Physics declarations do not import device assembly or experiments"
type = "forbidden"
source_modules = ["solarlab.physics"]
forbidden_modules = ["solarlab.config", "solarlab.device", "solarlab.experiments"]
# Parenthesized layers may be absent while WS3 creates its packages. They are
# enforced as soon as they exist; tests create each future layer and exercise
# direct and indirect violations without adding placeholder production modules.
[[tool.importlinter.contracts]]
name = "Physics does not depend on equation assembly"
type = "layers"
layers = ["(solarlab.equations)", "solarlab.physics"]
[[tool.importlinter.contracts]]
name = "Solvers do not depend on device assembly"
type = "layers"
layers = ["solarlab.device", "(solarlab.solvers)"]
[[tool.importlinter.contracts]]
name = "Low-level geometry stays below solvers and spatial experiments"
type = "layers"
layers = [
"solarlab.experiments.two_dimensional",
"(solarlab.solvers)",
"(solarlab.discretization)",
"(solarlab.mesh)",
]
[[tool.importlinter.contracts]]
name = "Solvers do not depend on experiment orchestration"
type = "forbidden"
source_modules = ["solarlab.solvers"]
forbidden_modules = ["solarlab.experiments"]
[[tool.importlinter.contracts]]
name = "Shared contracts do not import implementation layers"
type = "layers"
containers = ["solarlab"]
layers = [
"config : device : materials : reproducibility : units : physics : experiments : sweeps : cli : (io) : (mesh) : (discretization) : (equations) : (solvers)",
"(contracts)",
]