Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
256 lines (247 loc) · 8.61 KB
/
Copy pathpyproject.toml
File metadata and controls
256 lines (247 loc) · 8.61 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
[build-system]
build-backend = "hatchling.build"
requires = [ "hatch-vcs", "hatchling" ]
[project]
name = "skillmodels"
description = "Estimators for skill formation models"
readme = { file = "README.md", content-type = "text/markdown" }
keywords = [
"Econometrics",
"Economics",
"Estimation",
"Skill formation",
"Statistics",
]
license = { file = "LICENSE" }
requires-python = ">=3.14,<3.15"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.14",
"Topic :: Scientific/Engineering",
]
dynamic = [ "version" ]
dependencies = [
"beartype>=0.22",
"dags>=0.5.1",
"jax>=0.9",
"jupyter-book>=2",
"kaleido>=1.2",
"numpy>=2.4",
"optimagic>=0.5.4",
"pandas>=3",
"plotly>=6.6",
"pytask>=0.5.8",
"pytask-parallel>=0.5.2",
"scikit-learn>=1.5",
]
[[project.authors]]
name = "Janoś Gabler"
email = "janos.gabler@gmail.com"
[[project.maintainers]]
name = "Janoś Gabler"
email = "janos.gabler@gmail.com"
[[project.maintainers]]
name = "Hans-Martin von Gaudecker"
email = "hmgaudecker@uni-bonn.de"
[project.urls]
Github = "https://github.com/OpenSourceEconomics/skillmodels"
Repository = "https://github.com/OpenSourceEconomics/skillmodels"
Tracker = "https://github.com/OpenSourceEconomics/skillmodels/issues"
[tool.hatch]
version.source = "vcs"
metadata.allow-direct-references = true
build.hooks.vcs.version-file = "src/skillmodels/_version.py"
build.targets.sdist.exclude = [ "tests" ]
build.targets.sdist.only-packages = true
build.targets.wheel.only-include = [ "src" ]
build.targets.wheel.sources = [ "src" ]
[tool.pixi.dependencies]
filterpy = "*"
ipykernel = "*"
jupyterlab = "*"
nbformat = "*"
networkx = "*"
prek = "*"
pybaum = "*"
python = "~=3.14.0"
scikit-learn = "*"
scipy = "*"
h5py = ">=3.16.0,<4"
xlrd = ">=2.0.2,<3"
[tool.pixi.environments]
cuda = { features = [ "cuda" ], solve-group = "cuda" }
docs = { features = [ "docs" ], solve-group = "default" }
tests-cpu = { features = [ "tests" ], solve-group = "default" }
tests-cuda = { features = [ "tests", "cuda" ], solve-group = "cuda" }
type-checking = { features = [ "type-checking", "tests" ], solve-group = "default" }
tests-cuda12 = { features = [ "tests", "cuda" ], solve-group = "cuda" }
tests-cuda13 = { features = [ "tests", "cuda13" ], solve-group = "cuda13" }
[tool.pixi.feature.cuda]
platforms = [ "linux-64-cuda12" ]
[tool.pixi.feature.cuda.target.linux-64.dependencies]
cuda-nvcc = ">=12"
[tool.pixi.feature.cuda.target.linux-64.pypi-dependencies]
jax = { version = ">=0.7", extras = [ "cuda12" ] }
[tool.pixi.feature.cuda.tasks]
mem-cuda = """\
pytest -x -s --pdb --memray --fail-on-increase \
tests/test_likelihood_regression.py::test_likelihood_contributions_large_nobs\
"""
[tool.pixi.feature.cuda13]
platforms = [ "linux-64-cuda13" ]
[tool.pixi.feature.cuda13.target.linux-64.dependencies]
cuda-nvcc = ">=13"
[tool.pixi.feature.cuda13.target.linux-64.pypi-dependencies]
jax = { version = ">=0.9", extras = [ "cuda13" ] }
[tool.pixi.feature.docs.dependencies]
# Provides the `myst` Node CLI (and pulls in nodejs) that the jupyter-book PyPI
# wrapper shells out to; without it the build tries to install Node interactively
# and fails in CI (e.g. Read the Docs).
mystmd = "*"
[tool.pixi.feature.docs.tasks]
build-docs = { cmd = "jupyter book build --html", cwd = "docs" }
view-docs = { cmd = "jupyter book start", cwd = "docs" }
[tool.pixi.feature.tests.dependencies]
pytest = "*"
pytest-cov = "*"
pytest-xdist = "*"
snakeviz = "*"
xlrd = ">=2"
[tool.pixi.feature.tests.target.unix.dependencies]
pytest-memray = "*"
[tool.pixi.feature.tests.tasks]
tests = "pytest tests -m 'not long_running'"
tests-with-cov = "pytest tests --cov-report=xml --cov=./"
mem = """\
pytest -x -s --pdb --memray --fail-on-increase \
tests/test_likelihood_regression.py::test_likelihood_contributions_large_nobs\
"""
mem-on-clean-repo = """\
git status --porcelain && git diff-index --quiet HEAD -- && git rev-parse HEAD && \
pytest -x -s --pdb --memray --fail-on-increase \
tests/test_likelihood_regression.py::test_likelihood_contributions_large_nobs\
"""
[tool.pixi.feature.type-checking.pypi-dependencies]
matplotlib = "*" # required because of pandas
pandas-stubs = "*"
types-pytz = "*"
[tool.pixi.pypi-dependencies]
pdbp = "*"
skillmodels = { path = ".", editable = true }
[tool.pixi.workspace]
channels = [ "conda-forge" ]
platforms = [
"linux-64",
"osx-arm64",
"win-64",
{ name = "linux-64-cuda12", platform = "linux-64", cuda = "12" },
{ name = "linux-64-cuda13", platform = "linux-64", cuda = "13" },
]
[tool.ruff]
fix = true
unsafe-fixes = false
[tool.ruff.lint]
select = [ "ALL" ]
extend-ignore = [
"COM812", # Conflicts with ruff-format
"CPY001", # Missing copyright notice -- covered by the repo-level LICENSE file
"EM101", # Exception must not use a string literal
"EM102", # Exception must not use an f-string literal
"FBT002", # Boolean default positional argument in function definition
"FIX002", # Line contains TODO
"ISC001", # Conflicts with ruff-format
"PERF401", # Use a list comprehension to create a transformed list
"PLR0913", # Too many arguments in function definition
"PLR0917", # Too many positional arguments in function definition
"PLR2004", # Magic value used in comparison
"TC001", # Move application import into a type-checking block
"TC002", # Move third-party import into a type-checking block
"TC003", # Move standard library import into a type-checking block
"TRY003", # Long messages outside exception class
]
per-file-ignores."**/*.ipynb" = [
"ANN", # Missing type annotations on tutorial helpers.
"B018", # Found useless expression
"INP001", # File is part of an implicit namespace package
"PD010", # `.pivot_table` preferred -- presentation tables read fine without it.
"T201", # print found
]
per-file-ignores."tests/*" = [
"ANN", # Missing type annotations
"ARG001", # Unused function argument
"D103", # Missing docstring in public function
"FBT003", # Boolean positional value in function call
"INP001", # File is part of an implicit namespace package
"S101", # Use of assert detected
"T201", # print found (useful for manual inspection in long-running tests)
]
pydocstyle.convention = "google"
[tool.pyproject-fmt]
column_width = 88
max_supported_python = "3.14"
table_format = "long"
expand_tables = [
"tool.pixi.dependencies",
"tool.pixi.environments",
"tool.pixi.environments.cuda",
"tool.pixi.environments.docs",
"tool.pixi.environments.tests-cpu",
"tool.pixi.environments.tests-cuda",
"tool.pixi.environments.type-checking",
"tool.pixi.feature",
"tool.pixi.feature.cuda",
"tool.pixi.feature.cuda.target.linux-64.dependencies",
"tool.pixi.feature.cuda.target.linux-64.pypi-dependencies",
"tool.pixi.feature.cuda.tasks",
"tool.pixi.feature.docs",
"tool.pixi.feature.docs.dependencies",
"tool.pixi.feature.docs.tasks",
"tool.pixi.feature.tests",
"tool.pixi.feature.tests.dependencies",
"tool.pixi.feature.tests.target",
"tool.pixi.feature.tests.tasks",
"tool.pixi.feature.type-checking",
"tool.pixi.feature.type-checking.pypi-dependencies",
"tool.pixi.pypi-dependencies",
"tool.pixi.workspace",
]
collapse_tables = [ "tool.hatch", "tool.pytask", "tool.pytest", "tool.ty" ]
[tool.ty]
# ty resolves third-party imports from this pixi env (the official ty-pre-commit hook
# runs `ty check --no-project`, so uv neither creates a `.venv` nor resolves deps). Run
# `pixi install` once.
environment.python = ".pixi/envs/type-checking"
rules.ambiguous-protocol-member = "error"
rules.deprecated = "error"
rules.division-by-zero = "error"
rules.ignore-comment-unknown-rule = "error"
rules.ineffective-final = "error"
rules.invalid-enum-member-annotation = "error"
rules.invalid-ignore-comment = "error"
rules.invalid-legacy-positional-parameter = "error"
rules.possibly-missing-submodule = "error"
rules.redundant-cast = "error"
rules.unused-awaitable = "error"
rules.unused-ignore-comment = "error"
[tool.pytest]
ini_options.norecursedirs = [ "docs" ]
ini_options.addopts = [ "--pdbcls=pdbp:Pdb" ]
ini_options.markers = [
"end_to_end: end-to-end estimation tests requiring external data",
"integration: integration tests requiring MODEL2 + data",
"long_running: slow tests skipped in CI (run with -m long_running)",
]
ini_options.filterwarnings = [
"ignore::pandas.errors.PerformanceWarning",
]
[tool.yamlfix]
line_length = 88
none_representation = "null"
sequence_style = "block_style"