-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
151 lines (133 loc) · 4.52 KB
/
Copy pathpyproject.toml
File metadata and controls
151 lines (133 loc) · 4.52 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
[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"
[project]
name = "goldilocks-core"
version = "0.2.3"
description = "Materials machine learning tools for recommending DFT calculation inputs."
readme = "README.md"
license = "BSD-3-Clause"
license-files = ["LICENSE"]
requires-python = ">=3.12"
dependencies = [
"dscribe>=2.1",
"joblib==1.5.3",
"matminer>=0.10.1",
"numpy>=2.4.4",
"pandas>=2.0",
"pymatgen>=2026.3.23",
"requests>=2.32",
"scikit-learn==1.7.2",
"sklearn-quantile==0.1.1",
# The default k-points model (QRF + CGCNN metallicity) is a core capability,
# so its ML stack ships in the base install (decision: stfc/goldilocks-core#32).
# torch-geometric requires torch. The base install resolves torch from the
# CPU-only PyTorch index so the workbench image doesn't ship ~3.5G of unused
# CUDA/nvidia libraries. GPU hosts pull the CUDA wheel via an index override
# (see [tool.uv] below), not the default resolution.
"torch>=2.13.0",
"torch-geometric>=2.5",
]
[project.optional-dependencies]
http = ["fastapi", "pydantic>=2.12", "uvicorn"]
mcp = ["mcp", "pydantic>=2.12"]
[project.scripts]
goldilocks = "goldilocks_core.cli.core:main"
[dependency-groups]
dev = [
"mutmut>=3.7.0",
"pre-commit>=4.5.1",
"pytest>=9.0.3",
"pytest-cov>=7.1.0",
"ruff>=0.15.11",
"rust-just>=1.58",
]
[tool.uv]
package = true
# PyTorch publishes CPU and CUDA wheels on separate indexes. Pin torch to the
# CPU index so container/workbench builds don't ship ~3.5G of unused CUDA/nvidia
# libraries. GPU hosts override with `uv sync --index-strategy unsafe-best-match
# --extra-index-url https://download.pytorch.org/whl/cu130` (or set
# UV_EXTRA_INDEX_URL to the cu130 index) to pull the CUDA wheel instead.
# torch-geometric and other torch-* packages stay on PyPI; only torch itself is
# re-sourced, since it's the one that drags in the nvidia/triton wheels.
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch = [
{ index = "pytorch-cpu" },
]
[tool.pytest.ini_options]
addopts = ["--strict-markers", "-ra"]
pythonpath = ["src"]
testpaths = ["tests"]
markers = [
"unit: isolated behavior with controlled collaborators",
"integration: workflows crossing real package boundaries",
"physics: scientific invariants checked independently of implementation",
]
[tool.coverage.run]
branch = true
source = ["goldilocks_core"]
omit = ["/tmp/*"]
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"raise NotImplementedError",
]
show_missing = true
skip_covered = true
[tool.mutmut]
# source_paths creates parent directories for nested files; also_copy does not.
# Copy nested test inputs without web/node_modules or build outputs.
source_paths = [
"src/goldilocks_core",
"web/README.md",
".agents/skills/use-goldilocks/references/workflows.md",
".agents/skills/use-goldilocks/references/qe-scf-template.md",
]
# Documentation tests read these files and validate their relative links.
also_copy = ["README.md", "LICENSE", "docs"]
only_mutate = [
"src/goldilocks_core/advice/parameters.py",
"src/goldilocks_core/functionals.py",
"src/goldilocks_core/generation/registry.py",
"src/goldilocks_core/generation/qe/scf.py",
"src/goldilocks_core/kmesh/math.py",
"src/goldilocks_core/runtime/dispatch.py",
"src/goldilocks_core/runtime/graph.py",
"src/goldilocks_core/selection.py",
]
mutate_only_covered_lines = false
pytest_add_cli_args = ["-q"]
[tool.ruff]
target-version = "py312"
[tool.ruff.lint]
select = [
"E", "F", "I", # baseline
"B", # bugbear: real footguns
"UP", # modern python; ceremony prevention
"C4", # comprehensions over loops
"SIM", # collapse ceremony
"RET", # return discipline
"PIE", # useless constructs
"PERF", # needless work
"TID", # import hygiene, banned modules
"RUF", # ruff-specific: noqa discipline, mutable defaults
"BLE", # no blind exception catches
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"goldilocks_core.contracts".msg = "the contracts package was dissolved; import from the domain module that defines the name"
[tool.setuptools.package-data]
goldilocks_core = [
"ml/registry.toml",
"pseudo/registry.toml",
"examples/structures/*.cif",
"examples/structures/README.md",
]
[tool.ruff.lint.isort]
combine-as-imports = true