-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathpyproject.toml
More file actions
268 lines (241 loc) · 8.3 KB
/
pyproject.toml
File metadata and controls
268 lines (241 loc) · 8.3 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
[project]
name = "atomworks"
version = "2.2.0"
description = "A research-oriented data toolkit for training biomolecular deep-learning foundation models"
readme = "README.md"
requires-python = ">=3.11"
authors = [
{ name = "Institute for Protein Design", email = "contact@ipd.uw.edu" }
]
license = { file = "LICENSE.md" }
classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"License :: OSI Approved :: BSD License",
]
dependencies = [
# ... generic tools
"cython>=3.0.0,<4", # Cython compiler for C extensions
"cytoolz>=0.12.3,<1", # Cython-optimized tools for itertools and functional programming
"tqdm>=4.65.0,<5", # Fast, extensible progress bar for loops and more
# ... CLI & config management
"typer>=0.12.5,<1", # Modern CLI framework
# ... linear algebra, maths & ml
"numpy>=1.25.0,<3",
"scipy>=1.13.1,<2",
# ... data tools
"pandas>=2.2,<2.4", # Data manipulation and analysis
"pyarrow==17.0.0", # Columnar data format for efficient data storage and processing # TODO: Test later versions
# ... compression
"zstandard>=0.21.0,<1", # Zstandard compression for MSA files and other data
# ... bioinformatics
"py3Dmol>=2.2.1,<3", # Python wrapper for 3Dmol.js
"pymol-remote>=0.0.5", # Remote access to PyMOL from Python (has no dependencies)
"biotite==1.4.0", # Biotite is a Python library for bioinformatics # TODO: Test newer versions
"hydride>=1.2.3,<2", # Biotite-supported tool for hydrogen addition
# ... small molecule libraries
"rdkit>=2024.3.5,<2025.9",
]
[project.optional-dependencies]
ml = [
# atomworks-ml dependencies
"torch>=2.2.0,<2.8",
"einops>=0.7.0,<1",
"jaxtyping>=0.2.17,<1",
"beartype>=0.18.0,<1",
]
ase = [
# ASE (Atomic Simulation Environment) dataset support
"ase>=3.22.0,<4", # Atomic Simulation Environment
"ase-db-backends>=0.10.0,<1", # Database backends for ASE (PostgreSQL, MySQL, LMDB)
"lmdb>=1.5.0,<2", # LMDB backend for ASE database support (required for .aselmdb files)
]
openbabel = [
# Optional openbabel dependency
"openbabel-wheel==3.1.1.22",
]
dev = [
# Linters & formatters
"ruff==0.8.3",
# Testing tools
"pytest>=8.2.0,<9", # testing framework
"pytest-testmon>=2.1.1,<3", # run only tests related to changed code
"pytest-xdist>=3.6.1,<4", # run tests in parallel
"pytest-dotenv>=0.5.2,<1", # load environment variables from .env file
"pytest-cov>=4.1.0,<5", # generate coverage report
"pytest-benchmark>=5.0.0,<6", # benchmark tests for speed
# Jupyter notebooks
"ipykernel>=6.28.0", # IPython kernel for Jupyter
]
docs = [
"sphinx>=8.0.0,<9",
"sphinx-gallery>=0.19.0,<1",
"pydata-sphinx-theme>=0.16.1,<1",
"matplotlib>=3.10.0,<4",
]
[dependency-groups]
# Reference optional dependencies for native uv compatability (in addition to the pip compatability)
dev = ["atomworks[dev]"]
ml = ["atomworks[ml]"]
docs = ["atomworks[docs]"]
openbabel = ["atomworks[openbabel]"]
[project.urls]
homepage = "https://rosettacommons.github.io/atomworks/latest/index.html"
repository = "https://github.com/RosettaCommons/atomworks"
documentation = "https://rosettacommons.github.io/atomworks/latest/index.html"
[project.scripts]
atomworks = "atomworks_cli.__main__:main"
aw = "atomworks_cli.__main__:main"
# Build settings ----------------------------------------------------------------------
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[tool.hatch.build]
sources = ["src"]
packages = ["src/atomworks", "src/atomworks_cli"]
[tool.hatch.metadata]
allow-direct-references = true
dynamic = false # optional – this disables dynamic metadata guessing
# Code style settings -----------------------------------------------------------------
[tool.ruff]
line-length = 120
indent-width = 4
target-version = "py312"
exclude = [
"**/external",
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"env",
".venv",
"venv",
"data",
"dev.py"
]
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
# Enable auto-formatting of code examples in docstrings. Markdown,
# reStructuredText code/literal blocks and doctests are all supported.
docstring-code-format = true
docstring-code-line-length = 120
[tool.ruff.lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Enable a comprehensive set of rules for better code quality
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"I", # isort
"N", # pep8-naming
#"D", # pydocstyle
"UP", # pyupgrade -- use the latest supported python syntax
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
"NPY", # fix deprecated numpy functions / types
"RUF", # Ruff-specific rules
"T10", # catch accidental debugger breakpoints in code
"ANN", # type annotations
]
# Ignore specific rules that might conflict with our style or are too strict
ignore = [
"B006", # do not use mutable data structures for argument defaults
"D203", # 1 blank line required before class docstring
"D212", # Multi-line docstring summary should start at the first line
"D100", # Missing docstring in public module
"NPY002", # replacing legacy np.random.rand wih np.random.Generator
"E501", # line too long
"SIM108", # Replace if-else blocks
"ANN002", # missing annotation for `*args`
"ANN003", # missing annotation for `**kwargs`
"ANN204", # missing return type annotation for special method `__init__`
"ANN401", # disallow `Any` type
]
[tool.ruff.lint.pydocstyle]
convention = "google"
# Add per-file-ignores for specific cases
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Ignore unused imports in __init__.py files
"tests/*" = ["D", "E", "RUF", "ANN"] # Ignore docstring rules in tests
"docs/**/*.py" = ["E402"] # Ignore forcing imports to be at the top of the file
"docs/**/*.ipynb" = ["E402"] # Ignore forcing imports to be at the top of the file
"src/atomworks_cli/*" = ["B008"] # Ignore function calls in argument defaults for Typer CLI
# Allow one-letter variable names commonly used in scientific code.
[tool.ruff.lint.pep8-naming]
ignore-names = [
"L",
"B",
"N",
"M",
"C",
"S"
]
# Test settings --------------------------------------------------------------------------------
[tool.pytest.ini_options]
testpaths = "tests" # Only run tests in the tests directory (speeds up collection)
norecursedirs = "docs *.egg-info .git .tox htmlcov"
addopts = "--import-mode=importlib"
pythonpath = ["src/atomworks", "tests"]
markers = [
"requires_internet: marks tests that require an internet connection",
"requires_pymol_remote: marks tests that require a PyMOL remote connection to run",
"requires_x3dna: marks tests that require X3DNA to run",
"requires_digs: marks tests that can only succeed on the DIGS infrastructure at the IPD",
"slow: marks tests that are slow",
]
[tool.coverage.run]
parallel = true
source = ["src/atomworks"]
omit = [
"src/atomworks/version.py",
"tests/*",
"*/__init__.py",
"setup.py",
"*/version.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"pass",
"raise ImportError",
]