-
Notifications
You must be signed in to change notification settings - Fork 58
Expand file tree
/
Copy pathpyproject.toml
More file actions
236 lines (208 loc) · 6.88 KB
/
pyproject.toml
File metadata and controls
236 lines (208 loc) · 6.88 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
[project]
name = "proteinfoundation"
version = "1.1.0"
description = "Proteina-Complexa"
requires-python = ">=3.12"
dependencies = [
# Core utilities
"python-dotenv==1.0.1",
"einops==0.6",
"dm-tree==0.1.8",
"loguru==0.7.2",
"numpy>=1.23.5",
"tqdm==4.66.4",
"joblib==1.4.2",
"rich==14.0.0",
"omegaconf",
"pydantic",
"rich-click",
"multipledispatch",
"wget==3.2",
# ML/Deep Learning
"lightning>=2.5.0,<2.6", #2.6.1 caused loading weight issue
"hydra-core==1.3.1",
"ml-collections==0.1.1",
"jaxtyping",
"loralib",
"transformers>=5.3.0", #"transformers==4.48.3",
# Data processing
"pandas>=2.3.0",
"scipy==1.12.0",
"h5py",
"xarray",
"modin[ray]",
"deepdiff>=8.6.1",
# Visualization
"plotly",
"seaborn",
"scikit-learn",
# Bioinformatics
"biopandas==0.5.1",
"biopython",
"biotite>=0.41.0", # it gets later reset to 1.4.0 in the build_uv_env.sh script but it causes a conflict if set here
"cpdb-protein==0.2.0",
"mdtraj==1.10.2",
"ProDy==2.6.1", #error with 2.4.1
# Experiment tracking
"wandb==0.23.1",
]
[project.optional-dependencies]
dev = [
"ruff>=0.15.0",
"ipdb",
]
[project.scripts]
complexa = "proteinfoundation.cli.cli_runner:main"
complexa-download = "proteinfoundation.cli.cli_runner:download_main"
complexa-target = "proteinfoundation.cli.target_cli:main"
# Build system
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
# Allow direct references (git URLs) in dependencies
[tool.hatch.metadata]
allow-direct-references = true
[tool.uv]
extra-index-url = [
"https://download.pytorch.org/whl/cu126",
]
# Package configuration - using src/ layout
# Main package lives in src/proteinfoundation/
# Without installation, add src/ to PYTHONPATH for imports to work
[tool.hatch.build.targets.wheel]
packages = [
"src/proteinfoundation", # Main package in src/ layout
"community_models",
"script_utils",
]
# Source mappings:
# - "src" = "" strips src/ prefix so src/proteinfoundation becomes proteinfoundation
# - community_models subpackages exposed as top-level imports
[tool.hatch.build.targets.wheel.sources]
"src" = ""
"community_models/openfold" = "openfold"
"community_models/colabdesign" = "colabdesign"
"community_models/ProteinMPNN" = "ProteinMPNN"
"community_models/LigandMPNN" = "LigandMPNN"
[tool.ruff]
src = ["src"]
line-length = 120
indent-width = 4
target-version = "py312"
exclude = [
".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 = 88
[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"
]
# Ignore specific rules that might conflict with our style or are too strict
ignore = [
# --- Annotations (too noisy for ML research code) ---
"ANN001", # missing type annotation for function arg
"ANN002", # missing annotation for *args
"ANN003", # missing annotation for **kwargs
"ANN201", # missing return type for public function
"ANN202", # missing return type for private function
"ANN204", # missing return type for __init__
"ANN205", # missing return type for static method
"ANN206", # missing return type for class method
"ANN401", # disallow Any type
# --- Naming (ML math conventions: X, T, N, SO3, SE3) ---
"N801", # invalid class name
"N802", # uppercase function name
"N803", # uppercase argument name
"N805", # invalid first argument name for method
"N806", # uppercase variable in function
"N812", # lowercase imported as non-lowercase
"N816", # mixed-case variable in global scope
# --- Import ordering / structure ---
"E402", # module import not at top — common for conditional/sys.path imports
"F722", # forward annotation syntax error — false positives from jaxtyping
# --- Style preferences (not bugs, just alternatives) ---
"B006", # mutable default arguments — common in ML config patterns
"B007", # unused loop control variable — use _ convention gradually
"B023", # function uses loop variable — common in closures
"D100", # missing docstring in public module
"D203", # 1 blank line required before class docstring
"D212", # multi-line docstring summary should start at first line
"E501", # line too long — handled by formatter
"E731", # lambda assignment — style preference
"E741", # ambiguous variable name (l, I, O) — standard in math/ML
"NPY002", # legacy np.random — widespread in codebase
"SIM102", # collapsible if — can reduce readability
"SIM105", # use contextlib.suppress — style preference
"SIM108", # ternary instead of if-else — reduces readability
"SIM118", # use `in dict` instead of `in dict.keys()` — style
# --- Ruff-specific (noisy for existing codebase) ---
"RUF002", # ambiguous unicode character in docstring
"RUF005", # collection literal concatenation — `a + [b]` is clear
"RUF013", # implicit optional — `x: int = None` should be Optional[int]
"RUF059", # unused unpacked variable
# --- Comprehension style (not bugs) ---
"C414", # unnecessary double cast or process
"C416", # unnecessary comprehension
"C417", # unnecessary map
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"] # Ignore unused imports in __init__.py files