Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
481 lines (440 loc) 路 15.1 KB
/
Copy pathpyproject.toml
File metadata and controls
481 lines (440 loc) 路 15.1 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
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "tabpfn-extensions"
version = "0.6.3"
dependencies = [
"torch>=2.1",
"pandas>=2.2.2",
"scikit-learn>=1.6.0",
"scipy>=1.11.1",
"tabpfn>=8.4.0",
"tabpfn-common-utils[telemetry-interactive]>=0.2.13",
]
requires-python = ">=3.10"
authors = [
{ name = "Noah Hollmann", email = "noah.hollmann@charite.de" },
{ name = "Leo Grinsztajn" },
{ name = "Samuel M眉ller", email = "muellesa@cs.uni-freiburg.de" },
{ name = "Lennart Purucker" },
{ name = "Arjun Krishnakumar" },
{ name = "Max K枚rfer" },
{ name = "Shi Bin Hoo" },
{ name = "Robin Tibor Schirrmeister" },
{ name = "Frank Hutter", email = "fh@cs.uni-freiburg.de" },
{ name = "Eddie Bergman" },
{ name = "Klemens Fl枚ge" },
{ name = "Oscar Key" },
{ name = "Dominik Safaric" }
]
readme = "README.md"
description = "TabPFN: Foundation model for tabular data"
classifiers = [
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
]
license = { file = "LICENSE" }
[project.urls]
documentation = "https://priorlabs.ai/docs"
source = "https://github.com/PriorLabs/tabpfn-extensions"
[project.optional-dependencies]
interpretability = [
# get_tabpfn_inf_explainer needs shapiq>=1.4.0 (MarginalImputer +
# get_predict_function_and_model_type(..., class_index=...); 1.3.0 is broken
# via an unpackaged `overrides` dep). OddSHAP/ProxySHAP routing (see
# interpretability/shapiq.py) additionally needs shapiq>=1.6.0, which
# requires Python>=3.12; on older Python the routing falls back to shapiq's
# "auto" selection with a warning.
"shapiq>=1.6.0; python_version >= '3.12'",
"shapiq>=1.4.0; python_version < '3.12'",
# Surrogate backends: ProxySHAP uses XGBoost, OddSHAP LightGBM; without them
# both fall back to a weaker DecisionTree. Only needed where those estimators
# exist (shapiq>=1.6.0, i.e. Python>=3.12).
"xgboost>=2.1.0; python_version >= '3.12'",
# Capped below 4.7.0 to match the resolution-wide constraint in [tool.uv];
# see the note there. Worth revisiting once that cap can be dropped.
"lightgbm>=4.3.0,<4.8.0; python_version >= '3.12'",
"seaborn>=0.12.2",
# decoder_readout.plot_decoder_readout draws with matplotlib.
"matplotlib>=3.8.4",
]
# Install scikit-survival manually if you need SurvivalTabPFN
# `pip install scikit-survival`. Excluded due to GPL.
survival = []
many_class = []
unsupervised = []
bayesian_optimization = [
# Only needed for the benchmark objective in the example.
"botorch>=0.12.0",
]
# transformers for DINOv3, torchvision for its preprocessing, pillow for image decoding.
image = [
"transformers>=4.57.1",
"torchvision>=0.20",
"pillow>=10.4",
]
# Meta-package that installs all extensions
all = [
# scikit-survival not included; install manually if you need SurvivalTabPFN.
"tabpfn-extensions[interpretability,survival,bayesian_optimization,image]",
]
[dependency-groups]
# The minimum subset of the dev dependencies required to run the tests on the CI.
# The idea is to be as close to the deployment environment as possible.
ci = [
"pytest>=8.0.0",
"pytest-mock>=3.15.1",
"licensecheck>=2025.1.0",
]
dev = [
{include-group = "ci"},
"pre-commit>=3.0.0",
"ruff==0.8.6", # This must be the same version as in .pre-commit-config.yaml
"mypy>=1.0.0",
"pytest-xdist>=3.6.0",
"build>=1.3.0",
"twine>=6.2.0",
]
# Extra deps needed only to *run* the example scripts (see examples/), used by the
# example-file CI job. Deliberately not a published extra: the library itself does
# not need these, only the example demos do, and the examples ship in the repo (not
# the wheel), so anyone running them works from a clone where this group is available.
examples = [
# Only used by interpretability/shap_example.py for plotting.
# Floor is 0.46.0 (0.41.0 pins an unbuildable numba).
"shap>=0.46.0",
# Only used by interpretability/decoder_readout_example.py for the 2D
# embedding projection; the example falls back to PCA when it is absent.
"umap-learn>=0.5.0",
]
[tool.uv]
# lightgbm 4.7.0 switched to PEP 639 license metadata and PyPI reports no license
# at all for that release, so the CI license check sees an empty license and fails.
# tabpfn itself depends on lightgbm>=3.0, so the cap has to be a resolution-wide
# constraint; bounding it in the interpretability extra alone does not reach the
# transitive copy. Worth revisiting once PyPI reports its MIT license again.
constraint-dependencies = ["lightgbm<4.7.0"]
exclude-newer = "7 days"
exclude-newer-package = {torch = false, tabpfn = false}
[tool.licensecheck]
only_licenses = ["APACHE", "MIT", "BSD", "ISC", "PYTHON", "UNLICENSE", "UNKNOWN"]
ignore_packages = [
"certifi",
"fsspec",
"tabpfn*",
]
[tool.pytest.ini_options]
testpaths = ["tests"] # Where the tests are located
minversion = "8.0"
empty_parameter_set_mark = "xfail" # Prevents user error of an empty `parametrize` of a test
log_cli = false
log_level = "DEBUG"
xfail_strict = true
addopts = "--durations=10 -vv"
# https://github.com/astral-sh/ruff
[tool.ruff]
target-version = "py310"
line-length = 88
output-format = "full"
src = ["src", "tests", "examples"]
# misc/sklearn_compat.py is vendored verbatim from sklearn-compat upstream;
# excluding it from both lint and format keeps it byte-identical to upstream
# so future re-vendors are clean diffs.
extend-exclude = ["src/tabpfn_extensions/misc/sklearn_compat.py"]
[tool.ruff.lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
select = [
"A",
# "ANN", # Handled by mypy
"ARG",
"B",
"BLE",
# COM812 removed to avoid conflicts with formatter
"COM",
"C4",
"D",
# "DTZ", # One day I should know how to utilize timezones and dates...
"E",
# "EXE", Meh
"ERA",
"F",
"FBT",
"I",
# "ISC", # Favours implicit string concatenation
"INP",
# "INT", # I don't understand this one
"N",
"NPY",
"PD",
"PLC",
"PLE",
"PLR",
"PLW",
"PIE",
"PT",
"PTH",
# "PYI", # Specific to .pyi files for type stubs
"Q",
"PGH004",
"RET",
"RUF",
"C90",
"S",
# "SLF", # Private member accessed (sure, it's python)
"SIM",
# "TRY", # Good in principle, would take a lot of work to statisfy
"T10",
"T20",
"TID",
# TC003 replaced TCH003
"TC",
"UP",
"N",
"W",
"YTT",
]
ignore = [
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic mthod
"D203", # 1 blank line required before class docstring
"D205", # 1 blank line between summary and description
"D401", # First line of docstring should be in imperative mood
"N806", # Variable X in function should be lowercase
"E731", # Do not assign a lambda expression, use a def
"A002", # Shadowing a builtin
"A003", # Shadowing a builtin
"S101", # Use of assert detected.
"W292", # No newline at end of file
"PLC1901", # "" can be simplified to be falsey
"TC003", # Move stdlib import into TYPE_CHECKING
"COM812", # Missing trailing comma in imports
"PLR2004", # Magic numbers, gets in the way a lot
"PLR0915", # Too many statements
"N803", # Argument name `X` should be lowercase
"N802", # Function name should be lowercase
"PLR0913", # Too many arguments in function definition
"SIM102", # Use a single if statement instead of nested if
"B007", # Loop control variable not used within loop body
"N815", # Variable should not be mixedCase
"S311", # Standard pseudo-random generators not suitable for crypto
"RUF010", # Use explicit conversion flag
"RET504", # Unnecessary assignment before return
"RUF009", # Do not perform function call in dataclass defaults
"SIM105", # Use contextlib.suppress instead of try-except-pass
"PLW2901", # For loop variable overwritten by assignment target
"SIM114", # Combine if branches using logical or
"PLW0603", # Using global statement to update variable is discouraged
# These tend to be lighweight and confuse pyright
]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"docs",
]
# Exclude a variety of commonly ignored directories.
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"S101",
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in `__init__`
"ANN001",
"ANN201",
"FBT001",
"FBT002",
"D100",
"PLR2004",
"PD901", # X is a bad variable name. (pandas)
"TCH",
"N803",
"C901", # Too complex
"E501", # Line too long
"PIE790", # Unnecessary pass statement
"NPY002", # Replace legacy np.random calls
"PT011", # pytest.raises is too broad
"PT012", # pytest.raises block should contain a single simple statement
"ARG001", # Unused function argument
"ARG002", # Unused method argument
"PLR5501", # Use elif instead of else then if
"SIM102", # Use a single if statement instead of nested if
"RUF013", # PEP 484 prohibits implicit Optional
"T201", # print found
"RET505", # Unnecessary else after return
"PLR0912", # Too many branches
]
"__init__.py" = ["I002", "D104", "RUF022"] # Missing docstring in public package, __all__ is not sorted
"scripts/*.py" = [
"D100", # Missing docstring in public module
"PTH123", # open() should be replaced by Path.open()
"SIM115", # Use a context manager for opening files
"PTH118", # os.path.join() should be replaced by Path
"PTH100", # os.path.abspath() should be replaced by Path.resolve()
"T201", # print found
"E501", # Line too long
"RET505", # Unnecessary else after return
]
"examples/*" = [
"INP001", "I002", "E741", "D101", "D103", "T20",
"D415", "ERA001", "E402", "E501", "D100", "NPY002",
"PD901"
]
"docs/*" = ["INP001"]
# Temporarily ignore docstring and line length issues in existing files
"src/tabpfn_extensions/**/*.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D105", # Missing docstring in magic method
"D107", # Missing docstring in public __init__
"D205", # Missing blank line after summary
"D415", # First line should end with a period
"D417", # Missing argument description in docstring
"E501", # Line too long
"B904", # Within an except clause, raise exceptions with from err
"NPY002", # Replace legacy np.random calls
"TC001", # Move application import into a type-checking block
"RET505", # Unnecessary else/elif after return statement
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"ARG001", # Unused function argument
"ARG002", # Unused method argument
"C901", # Function is too complex
"PLR0912", # Too many branches
"PIE790", # Unnecessary pass statement
"PD011", # Use .to_numpy() instead of .values
"RUF022", # __all__ is not sorted
]
[tool.ruff.lint.isort]
known-first-party = ["tabpfn"]
known-third-party = ["sklearn"]
no-lines-before = ["future"]
required-imports = ["from __future__ import annotations"]
combine-as-imports = true
extra-standard-library = ["typing_extensions"]
force-wrap-aliases = true
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
max-args = 10 # Changed from default of 5
[tool.mypy]
python_version = "3.10"
packages = ["src/tabpfn_extensions", "tests"]
show_error_codes = true
warn_unused_configs = true # warn about unused [tool.mypy] lines
follow_imports = "normal" # Type check top level api code we use from imports
ignore_missing_imports = true # Temporarily set to true to handle modules without stubs
disallow_untyped_defs = false # Temporarily set to false while we add types
disallow_untyped_decorators = false
disallow_incomplete_defs = false
no_implicit_optional = true
check_untyped_defs = true
warn_return_any = true
[[tool.mypy.overrides]]
module = ["tests.*"]
disallow_untyped_defs = false # Sometimes we just want to ignore verbose types
disallow_untyped_decorators = false # Test decorators are not properly typed
disallow_incomplete_defs = false # Sometimes we just want to ignore verbose types
disable_error_code = ["var-annotated"]
[[tool.mypy.overrides]]
module = [
]
ignore_errors = true
[[tool.mypy.overrides]]
module = ["sklearn.*"]
ignore_missing_imports = true
[tool.pyright]
include = ["src", "tests"]
pythonVersion = "3.10"
typeCheckingMode = "strict"
strictListInference = true
strictSetInference = true
strictDictionaryInference = false
reportImportCycles = false
reportMissingSuperCall = true
reportMissingTypeArgument = false
reportOverlappingOverload = true
reportIncompatibleVariableOverride = true
reportIncompatibleMethodOverride = true
reportInvalidTypeVarUse = true
reportCallInDefaultInitializer = true
reportImplicitOverride = true
reportUnknownMemberType = false
reportUnknownParameterType = false
reportUnknownVariableType = false
reportUnknownArgumentType = false
reportUnknownLambdaType = false
reportPrivateUsage = false
reportUnnecessaryCast = false
reportUnusedFunction = false
reportMissingTypeStubs = false
reportPrivateImportUsage = false
reportUnnecessaryComparison = false
reportConstantRedefinition = false
reportUntypedFunctionDecorator = false
[tool.changelog-bot.towncrier_changelog]
enabled = true
changelog_skip_label = "no changelog needed"
[tool.towncrier]
directory = "changelog"
filename = "CHANGELOG.md"
start_string = "## [Unreleased]\n"
title_format = "## [{version}] - {project_date}"
issue_format = "[#{issue}](https://github.com/PriorLabs/tabpfn-extensions/pull/{issue})"
[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking Changes"
showcontent = true
[[tool.towncrier.type]]
directory = "added"
name = "Added"
showcontent = true
[[tool.towncrier.type]]
directory = "changed"
name = "Changed"
showcontent = true
[[tool.towncrier.type]]
directory = "fixed"
name = "Fixed"
showcontent = true
[[tool.towncrier.type]]
directory = "deprecated"
name = "Deprecated"
showcontent = true
[[tool.towncrier.section]]
path = ""
name = ""