forked from pwhofman/probly
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
225 lines (209 loc) · 5.63 KB
/
pyproject.toml
File metadata and controls
225 lines (209 loc) · 5.63 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
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "probly"
dynamic = ["version", "readme"]
description = "Uncertainty Representation and Quantification for Machine Learning"
license = "MIT"
requires-python = ">=3.12,<3.14"
dependencies = [
"scipy",
"matplotlib>=3.8.0",
"mpltern",
"numpy>=2.0.0",
"scikit-learn",
"tqdm",
"joblib",
]
authors = [
{name = "Paul Hofman", email = "paul.hofman@ifi.lmu.de"},
{name = "Timo Löhr"},
{name = "Maximilian Muschalik"},
{name = "Clemens Damke"},
{name = "Alireza Javanmardi"}
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
'Operating System :: Microsoft :: Windows',
'Operating System :: Unix',
'Operating System :: MacOS',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
]
[tool.setuptools.packages.find]
where = ["./src"]
include = ["probly*", "pytraverse*", "lazy_dispatch*"]
[tool.setuptools.dynamic]
version = {attr = "probly.__version__"}
readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"}
[project.urls]
documentation = "https://pwhofman.github.io/probly"
source = "https://github.com/pwhofman/probly"
tracker = "https://github.com/pwhofman/probly/issues"
changelog = "https://github.com/pwhofman/probly/blob/main/CHANGELOG.md"
[dependency-groups]
torch = [
"torch>=2.0.0",
"torchvision",
]
jax = [
"jax>=0.8.0",
"flax>=0.12.0",
]
jax-cuda12 = [
"jax[cuda12]",
]
all_ml = [
{include-group = "torch"},
{include-group = "jax"},
]
test = [
"pytest>=8.3.5", # for testing
"pytest-cov>=6.0.0", # for coverage
"pytest-xdist>=3.6.1", # for parallel testing
"packaging", # for version parsing
]
lint = [
"ruff>=0.14.1", # for linting
"pre-commit>=4.3.0", # for running the linters pre-commit hooks
"mypy>=1.18.2" # for static type checking
]
docs = [
"sphinx>=8.0.0",
"furo", # Beautiful modern theme (or use sphinx-rtd-theme)
"myst-nb", # Optional: Jupyter Notebook support
"sphinx-copybutton", # Optional: Adds copy buttons to code blocks
"sphinx-autodoc-typehints", # Optional: Show type hints in your API docs
"sphinxcontrib-bibtex", # Optional: For bibliography support
]
dev = [
"ipykernel>=6.29.5",
"notebook>=7.3.3",
"ipywidgets",
{include-group = "test"},
{include-group = "lint"},
{include-group = "docs"},
{include-group = "all_ml"},
]
[tool.ruff]
line-length = 120
target-version = "py312"
output-format = "full"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"N812", # Checks for lowercase imports that are aliased to non-lowercase names (e.g. torch.nn.functional as F)
"RET504", # Unnecessary assignment to {name} before return statement
"PLR2004", # Magic value used in comparison, consider replacing {value} with a constant variable
"FBT", # enforce keyword for bool
"PLR0913", # too many arguments (>5)
"FIX002", # TODOs are fine in code
]
# Exclude a variety of commonly ignored directories.
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",
"venv",
"docs/build",
]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"S101",
"INP001",
"D101",
"D102",
"D103",
"D404",
"ANN001",
"ANN201",
"ANN202",
"FBT001",
"D100",
"PLR2004",
"PD901",
"TCH",
"N803",
"C901",
]
"tests/pytraverse/**/*.py" = ["ARG001"]
"__init__.py" = [
"I002", # to not need from __future__ import annotations
"PLC0414", # to allow import module as module in inits, contradicts F401
]
"*.ipynb" = [
"T20",
"NPY002",
"I002",
"D101",
"D103",
"PERF401", # it's fine to have non-optimized code in notebooks
]
"docs/**/*.py" = [
"INP001",
"PTH",
"I002"
]
# Use isort-compatible settings
[tool.ruff.lint.isort]
known-first-party = ["probly", "pytraverse", "lazy_dispatch"]
force-sort-within-sections = true
combine-as-imports = true
force-single-line = false
no-lines-before = ["future"]
required-imports = ["from __future__ import annotations"]
extra-standard-library = ["typing_extensions"]
[tool.pytest.ini_options]
testpaths = ["tests"]
minversion = "8.0"
addopts = [
"--import-mode=importlib", # to avoid issues with lazy imports
]
[tool.coverage.report]
exclude_also = [
"def __repr__",
"if __name__ == .__main__.:",
"\\s*\\.\\.\\.\\s*",
]
exclude_lines = [
"if TYPE_CHECKING",
]
[tool.mypy]
python_version = "3.13"
strict = true
ignore_missing_imports = true # to avoid issues with torch, numpy, scipy, etc. stubs
disallow_subclassing_any = false # to make sure we can subclass from e.g. torch.nn.Module
disallow_any_generics = false # to avoid warnings for type-based singledispatch
disallow_untyped_calls = false # to avoid issues with using torch, numpy, scipy, etc. internals
disable_error_code = "misc" # disable errors caused by torch not typing decorators, wrapping would be overkill
exclude = "docs"