Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
203 lines (182 loc) · 5.8 KB
/
Copy pathpyproject.toml
File metadata and controls
203 lines (182 loc) · 5.8 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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "pytensor_ml"
dynamic = ["version"]
description = "A(nother) deep learning library, built on top of Pytensor"
readme = "README.md"
requires-python = ">=3.12"
authors = [{name="Jesse Grabowski", email='jessegrabowski@gmail.com'}, {name="Ricardo Vieira"}]
license = "Apache-2.0"
license-files = ["LICENSE"]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Topic :: Scientific/Engineering",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
keywords = [
"neural network",
"deep learning",
"autograd",
"gradient descent",
"pymc"
]
dependencies = [
"pytensor>=3.3.3,<4.0.0",
"numpy",
]
[project.urls]
Homepage = "https://github.com/pymc-devs/pytensor-ml"
Documentation = "https://pytensor-ml.readthedocs.io"
Source = "https://github.com/pymc-devs/pytensor-ml"
Tracker = "https://github.com/pymc-devs/pytensor-ml/issues"
[project.optional-dependencies]
dev = [
"safetensors",
"cloudpickle",
"pre-commit",
"pytest",
"pytest-cov",
"scikit-learn",
"mypy",
"jax",
"pyyaml",
]
examples = [
"matplotlib",
"tqdm",
]
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "pytensor_ml/_version.py"
[tool.pytest.ini_options]
minversion = "6.0"
xfail_strict=true
# A checkpoint test reads a published snapshot of several GB from disk, so it runs only when asked
# for: `pytest -m checkpoint`.
addopts = "-m 'not checkpoint'"
markers = [
"checkpoint: needs a full published checkpoint on disk, not a fixture",
]
filterwarnings = [
"error",
'ignore:\nArviZ is undergoing a major refactor.*:FutureWarning',
# pytensor silences this on import, but our "error" rule above resets the
# warnings filter per-test and undoes it. Numba emits it from the numba
# linker, which is pytensor 3's default.
"ignore::numba.core.errors.NumbaPerformanceWarning",
# torch.compile pulls in inductor, which imports torch.utils.mkldnn, whose class bodies still call
# the deprecated torch.jit.script_method. Raising here aborts the import half-done, so every later
# torch-mode test retries it and fails the same way. The message past this prefix depends on the
# Python version.
"ignore:`torch.jit.script_method` is:DeprecationWarning",
# pytensor hands torch its constants as the read-only numpy arrays it stores them in.
"ignore:The given NumPy array is not writable:UserWarning",
]
[tool.ruff]
line-length = 100
target-version = "py312"
exclude = ["pytensor_ml/_version.py"]
[tool.ruff.lint]
select = ["D", "E", "F", "I", "UP", "W", "RUF", "TID252"]
ignore = [
"E501", # Line too long
"RUF001", # String contains ambiguous character (such as Greek letters)
"RUF002", # Docstring contains ambiguous character (such as Greek letters)
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
"RUF059", # Unpacked variable is never used (noisy for `X, y = fixture` unpacking)
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D107",
"D200",
"D202",
"D203",
"D204",
"D205",
"D209",
"D212",
"D213",
"D301",
"D400",
"D401",
"D403",
"D413",
"D415",
"D417",
]
fixable = ["ALL"]
[tool.ruff.lint.per-file-ignores]
# An __init__.py re-exports its package's API and imports submodules for their registration side effects.
"**/__init__.py" = ["F401"]
[tool.ruff.lint.isort]
lines-between-types = 1
[tool.mypy]
python_version = "3.12"
ignore_missing_imports = true
strict_equality = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
# pytensor ops are typed to return Any, so returning their results from a function annotated with a
# concrete tensor type fires constantly without catching real bugs in our code.
warn_return_any = false
warn_unreachable = true
files = ["pytensor_ml"]
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["osx-arm64", "linux-64", "win-64"]
# Autodoc imports pytensor_ml, so the docs environment needs the runtime stack alongside sphinx.
# Read the Docs cannot read a pixi environment, so it builds from conda_envs/environment-docs.yml;
# the two lists have to move together.
[tool.pixi.feature.docs.dependencies]
python = ">=3.12"
pytensor = ">=3.3.3,<3.4.0"
numpy = "*"
safetensors = "*"
# The gallery extension renders notebook thumbnails with matplotlib.
matplotlib = "*"
ipython = "*"
jupyter = "*"
sphinx = ">=7"
pydata-sphinx-theme = "*"
myst-nb = "*"
numpydoc = "*"
sphinx-copybutton = "*"
sphinx-design = "*"
sphinx-codeautolink = "*"
sphinx-sitemap = "*"
sphinx-notfound-page = "*"
sphinx-autobuild = "*"
jupyter-sphinx = "*"
sphinxcontrib-bibtex = "*"
[tool.pixi.feature.docs.pypi-dependencies]
pytensor_ml = { path = ".", editable = true }
[tool.pixi.feature.docs.tasks]
docs-build = { cmd = "sphinx-build -b html source build/html", cwd = "docs" }
# Rebuilds on save and serves the result at http://localhost:8000. The ignored paths are the ones a
# build writes back into source/ -- the gallery pages and staged notebooks, their thumbnails, and the
# autosummary stubs -- which would otherwise retrigger the watcher and rebuild forever. They are the
# same set docs/.gitignore lists, and have to move together.
docs-serve = { cmd = """\
sphinx-autobuild source build/html --port 8000 --open-browser \
--ignore '*/source/examples/*' \
--ignore '*/source/_thumbnails/*' \
--ignore '*/source/api/generated/*'\
""", cwd = "docs" }
[tool.pixi.environments]
docs = { features = ["docs"] }