-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathpyproject.toml
More file actions
261 lines (246 loc) · 6.98 KB
/
Copy pathpyproject.toml
File metadata and controls
261 lines (246 loc) · 6.98 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
[build-system]
requires = ["setuptools>=68.0", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"
[project]
name = "q2mm"
dynamic = ["version"]
description = "Quantum-guided molecular mechanics force field optimization"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "MIT" }
authors = [
{ name = "Eric Hansen" },
]
keywords = [
"force-field",
"molecular-mechanics",
"optimization",
"transition-state",
"computational-chemistry",
"Q2MM",
"OpenMM",
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: Chemistry",
]
dependencies = [
"numpy",
"pyyaml",
]
[tool.setuptools_scm]
# Version derived from git tags: git tag v5.0.0 → version 5.0.0
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"
[project.optional-dependencies]
amber = [
"parmed",
]
openmm = [
"openmm",
]
openmm-cuda = [
"openmm",
"OpenMM-CUDA-12; platform_system != 'Darwin'",
]
optimize = [
"scipy",
]
qm = [
"pint",
]
jax = [
"jax",
"jaxlib",
"jaxopt",
"optax",
"scipy",
]
jax-md = [
"jax-md; sys_platform != 'win32'",
"jax; sys_platform != 'win32'",
"jaxlib; sys_platform != 'win32'",
"scipy",
]
gpu = [
"jax[cuda12]; sys_platform != 'win32'",
"jaxopt; sys_platform != 'win32'",
"scipy",
]
qcel = [
"qcelemental",
]
qcengine = [
"qcengine",
]
ase = [
"ase",
]
dev = [
"pytest",
"pytest-benchmark",
"pytest-cov",
"ruff",
"mypy",
"scipy",
"parmed",
"qcelemental",
"qcengine",
"ase",
"openmm",
"build",
"tomli; python_version < '3.11'",
]
docs = [
"properdocs",
"mkdocs-material",
"mkdocstrings[python]",
"mkdocs-gen-files",
"mkdocs-literate-nav",
"mkdocs-section-index",
]
all = [
"openmm",
"parmed",
"pint",
"scipy",
"qcelemental",
"qcengine",
"ase",
"jax",
"jaxlib",
"jax-md; sys_platform != 'win32'",
]
[project.scripts]
q2mm-benchmark = "q2mm.benchmarks.cli:main"
[project.urls]
Homepage = "https://github.com/ericchansen/q2mm"
Documentation = "https://ericchansen.github.io/q2mm/"
Repository = "https://github.com/ericchansen/q2mm"
Issues = "https://github.com/ericchansen/q2mm/issues"
Changelog = "https://github.com/ericchansen/q2mm/releases"
[tool.setuptools.packages.find]
include = ["q2mm*"]
namespaces = false
[tool.setuptools]
include-package-data = false
[tool.setuptools.package-data]
q2mm = [
"py.typed",
"data/sn2/manifest.json",
"data/sn2/*.npy",
"data/sn2/*.npz",
"data/sn2/*.txt",
"data/sn2/*.xyz",
]
[tool.pytest.ini_options]
testpaths = ["test"]
addopts = ""
markers = [
"benchmark: performance benchmark tests (requires pytest-benchmark; use --benchmark-enable to collect timing)",
"cross_backend: parity tests that execute two or more backend implementations",
"integration: backend integration tests ~1-10s each (requires --run-integration)",
"validation: correctness validation with no optimizer loops ~1-30s each (requires --run-validation)",
"nightly: heavy tests with optimizer loops or large systems ~1-10min each (requires --run-nightly)",
]
[tool.ruff]
line-length = 120
target-version = "py310"
extend-exclude = ["*.ipynb"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.ruff.lint]
select = [
"E", "F", "W", # pycodestyle + pyflakes
"UP", # pyupgrade
"SIM", # flake8-simplify
"ANN", # flake8-annotations (type hints)
"D", # pydocstyle (docstrings)
"ERA", # eradicate (commented-out code)
]
ignore = [
"E402", # module-import-not-at-top (conditional imports)
"E501", # line too long (let formatter handle)
"E701", # multiple statements on one line
"E741", # ambiguous variable name (common in scientific code)
"F841", # unused variable (common in scientific iteration / tuple unpacking)
"SIM102", # collapsible-if (readability preference)
"SIM108", # ternary (readability preference in scientific code)
"ANN401", # any-type (too strict for scientific code with numpy/openmm)
"D105", # undocumented-magic-method (usually obvious)
"D107", # undocumented-public-init (docstring goes on class)
"D203", # incorrect-blank-line-before-class (conflicts with D211)
"D213", # multi-line-summary-second-line (conflicts with D212)
]
[tool.ruff.lint.per-file-ignores]
"test/**" = [
"D100", # undocumented-public-module (test modules)
"D101", # undocumented-public-class (test classes)
"D102", # undocumented-public-method (test methods — name is the doc)
"D103", # undocumented-public-function (test helpers)
"D104", # undocumented-public-package
]
[tool.mypy]
# Target 3.12 (the CI Lint job's Python) as a single source of truth so plain
# `python -m mypy q2mm/` matches CI locally. numpy>=2.5 ships PEP 695 `type`
# aliases in its stubs that mypy rejects under python_version=3.10 (a fatal
# stub parse error that halts all checking), so 3.10 is not a usable target
# here. The >=3.10 runtime floor is still enforced by ruff (target-version=
# py310) and the 3.10 test-core matrix.
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false # too strict for existing codebase
check_untyped_defs = true
ignore_missing_imports = true
# Grandfathered modules: mypy is enforced repo-wide via the CI Lint job, but
# the modules listed below carry pre-existing type errors. They are still
# followed for type info, but their own errors are not reported — so any NEW
# module, or any module removed from this list, must be mypy-clean.
# Un-grandfather modules one at a time as their errors are fixed.
# See https://mypy.readthedocs.io/en/stable/existing_code.html
[[tool.mypy.overrides]]
ignore_errors = true
module = [
"q2mm.backends.mm",
"q2mm.backends.mm._jax_common",
"q2mm.backends.mm.batched",
"q2mm.backends.mm.jax_engine",
"q2mm.backends.mm.jax_md_engine",
"q2mm.backends.mm.openmm",
"q2mm.backends.mm.tinker",
"q2mm.backends.qm.psi4",
"q2mm.backends.registry",
"q2mm.io._helpers",
"q2mm.io.amber",
"q2mm.io.cmap",
"q2mm.io.gaussian",
"q2mm.io.jaguar",
"q2mm.io.macromodel",
"q2mm.io.mm3",
"q2mm.io.mol2",
"q2mm.io.openmm",
"q2mm.io.reference",
"q2mm.io.tinker",
"q2mm.models.forcefield",
"q2mm.models.hessian",
"q2mm.models.molecule",
"q2mm.models.seminario",
"q2mm.optimizers.cycling",
"q2mm.optimizers.jax_multistart",
"q2mm.optimizers.jaxopt_opt",
"q2mm.optimizers.optax",
"q2mm.optimizers.scipy_opt",
"q2mm.workflows.method_e2",
]