Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
214 lines (185 loc) · 5.64 KB
/
Copy pathpyproject.toml
File metadata and controls
214 lines (185 loc) · 5.64 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
[project]
name = "plenoptic"
dynamic = ["version"]
authors = [{name="Plenoptic authors"}]
description = "Python library for model-based stimulus synthesis."
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Science/Research",
]
keywords = ['neuroscience', 'pytorch', 'visual information processing', 'machine learning', 'explainability', 'computational models']
dependencies = [
"numpy>=1.1",
"torch>=1.8,!=1.12.0",
"pyrtools>=1.0.11",
"scipy>=1.0",
"matplotlib>=3.3",
"tqdm>=4.29",
"imageio>=2.5",
"scikit-image>=0.15.0",
"einops>=0.3.0",
"importlib-resources>=6.0",
# for updated tarfile behavior, https://github.com/plenoptic-org/plenoptic/issues/336
"pooch>=1.9.0",
"lazy_loader",
]
[build-system]
requires = ["setuptools", "setuptools-scm[toml]"]
build-backend = "setuptools.build_meta"
[project.optional-dependencies]
docs = [
'sphinx',
'pydata-sphinx-theme',
'sphinx-autodoc-typehints',
'sphinx-copybutton',
"myst-parser[linkify]",
"sphinxcontrib-bibtex>=2.6.4",
"sphinx-design",
"myst-nb",
"ipywidgets",
"torchvision",
"timm",
"jupytext",
"sphobjinv",
"sphinx-togglebutton",
]
test = [
# 9.1.0 unsupported because of https://github.com/pytest-dev/pytest/issues/14591
"pytest>=5.1.2,!=9.1.0",
'pytest-cov',
'pytest-xdist',
'pytest-order',
"torchvision",
"timm",
]
lint = [
"ruff>=0.6.8",
'numpydoc',
]
dev = ["plenoptic[test,lint]"]
nb = [
"jupyter",
"jupyterlab>=4.5",
"jupyterlab_myst>=2.6",
"ipywidgets",
"nbclient>=0.5.5",
"torchvision>=0.3",
"jupytext",
"myst-nb",
]
[project.urls]
"Homepage" = "https://github.com/plenoptic-org/plenoptic"
"Documentation" = "https://docs.plenoptic.org"
"Download" = "https://zenodo.org/doi/10.5281/zenodo.10151130"
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools_scm]
version_scheme = 'semver-pep440'
local_scheme = 'no-local-version'
[tool.pytest.ini_options]
addopts = "--cov=plenoptic --cov-append -n auto --cov-report term --dist worksteal"
testpaths = ["tests"]
doctest_optionflags = "NORMALIZE_WHITESPACE NUMBER ELLIPSIS"
# ignore a bunch of common plenoptic-generated warnings, and raise errors
# otherwise. this way we can actually stay on top of deprecations etc. Per docs
# (https://docs.pytest.org/en/stable/how-to/capture-warnings.html#controlling-warnings):
# "When a warning matches more than one option in the list, the action for the
# last matching option is performed."
filterwarnings = [
"error",
# seems to be necessary to solve https://github.com/pytest-dev/pytest-cov/issues/693
"ignore:Failed to generate report:",
]
# seems to be necessary to solve https://github.com/pytest-dev/pytest-cov/issues/693
[tool.coverage.run]
disable_warnings = ["module-not-measured"]
[tool.ruff]
extend-include = ["*.ipynb"]
src = ["src", "tests", "examples"]
# Exclude a variety of commonly ignored directories.
exclude = []
# Set the maximum line length (same as Black)
line-length = 88
indent-width = 4 # same as Black
[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"
docstring-code-format = true
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes: basic static analysis for common errors like undefined names
# and missing imports.
"F",
# pyupgrade
"UP",
# flake8-simplify
"SIM",
# isort
"I",
# in particular, this looks for invalid escape sequences (has been an issue
# for regex strings used in tests)
"W",
# docstrings, note that DOC rules (pydoclint) are all in preview, so have to be explicitly added
"D", "DOC201", "DOC202", "DOC402", "DOC403", "DOC501",
"ANN",
# catch missing f-strings (this is in preview and so has to be explicitly added)
"RUF027",
]
ignore = []
# allow preview rules, but require them to be explicitly added
preview = true
explicit-preview-rules = true
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
suppress-none-returning = true
[tool.ruff.lint.per-file-ignores]
# Ignore docstring rules everywhere except for the `src/` directory, from
# https://docs.astral.sh/ruff/settings/#lint_per-file-ignores.
"!src/**.py" = ["D", "DOC", "ANN"]
# this file has very long lines
"src/plenoptic/_api_change.py" = ["E501"]
# exercise notebooks sometimes will have undefined names in the skipped cells
"exercises*ipynb" = ["F821"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.numpydoc_validation]
checks = [
"all",
"SA01",
# will remove this eventually
"EX01",
"PR04",
]
# don't report on objects that match any of these regex
exclude = [
"__dir__",
# init has no docstring, documented in the class docstring
"__init__",
"noxfile",
"_api_change",
]
[tool.codespell]
# Ref: https://github.com/codespell-project/codespell#using-a-config-file
skip = '.git*,*.svg,*.css,*.pgm'
check-hidden = true
# ignore regex like [Tt]rue
ignore-regex = '\[[A-Z][a-z]\][a-z]+'
# ignore-words-list = ''
dictionary = "plenoptic-dict.txt,-"