-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpyproject.toml
312 lines (238 loc) · 8.41 KB
/
pyproject.toml
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
# ======================================================================================
# Project metadata
# ======================================================================================
[project]
name = "skillmodels"
authors = [
{ name = "Janoś Gabler", email = "janos.gabler@gmail.com" },
]
maintainers = [
{ name = "Janoś Gabler", email = "janos.gabler@gmail.com" },
{ name = "Hans-Martin von Gaudecker", email = "hmgaudecker@uni-bonn.de" },
]
description = "Estimators for skill formation models"
requires-python = ">=3.12"
dependencies = [
"dags",
"numpy",
"pandas",
]
dynamic = ["version"]
keywords = [
"Skill formation",
"Econometrics",
"Economics",
"Estimation",
"Statistics",
]
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",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering",
]
[project.readme]
file = "README.md"
content-type = "text/markdown"
[project.license]
text = "MIT"
[project.urls]
Repository = "https://github.com/OpenSourceEconomics/skillmodels"
Github = "https://github.com/OpenSourceEconomics/skillmodels"
Tracker = "https://github.com/OpenSourceEconomics/skillmodels/issues"
# ======================================================================================
# Build system configuration
# ======================================================================================
[build-system]
requires = ["hatchling", "hatch_vcs"]
build-backend = "hatchling.build"
[tool.hatch.build.hooks.vcs]
version-file = "src/skillmodels/_version.py"
[tool.hatch.build.targets.sdist]
exclude = ["tests"]
only-packages = true
[tool.hatch.build.targets.wheel]
only-include = ["src"]
sources = ["src"]
[tool.hatch.version]
source = "vcs"
[tool.hatch.metadata]
allow-direct-references = true
# ======================================================================================
# Pixi
# ======================================================================================
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-64", "osx-arm64", "win-64"]
# Development Dependencies (conda)
# --------------------------------------------------------------------------------------
[tool.pixi.dependencies]
filterpy = "*"
jupyterlab = "*"
nbformat = ">=5.10.4,<6"
optimagic = "*"
pixi-kernel = ">=0.4.0,<0.5"
plotly = ">=5.2,<6"
pre-commit = "*"
pybaum = "*"
python = ">=3.12.5"
python-kaleido = "*"
scipy = "<=1.13"
# Development Dependencies (pypi)
# --------------------------------------------------------------------------------------
[tool.pixi.target.unix.dependencies]
jax = ">=0.4.20"
jaxlib = ">=0.4.20"
# Development Dependencies (pypi)
# --------------------------------------------------------------------------------------
[tool.pixi.pypi-dependencies]
pdbp = "*"
skillmodels = {path = ".", editable = true}
[tool.pixi.target.win-64.pypi-dependencies]
jax = { version = ">=0.4.20", extras = ["cpu"] }
jaxlib = ">=0.4.20"
# Features and Tasks
# --------------------------------------------------------------------------------------
[tool.pixi.feature.cuda]
platforms = ["linux-64"]
system-requirements = {cuda = "12"}
[tool.pixi.feature.cuda.target.linux-64.dependencies]
cuda-nvcc = ">=12"
jax = ">=0.4.20"
jaxlib = { version = ">=0.4.20", build = "cuda12*" }
[tool.pixi.feature.test.dependencies]
pytest = "*"
pytest-cov = "*"
pytest-xdist = "*"
snakeviz = "*"
[tool.pixi.feature.test.target.unix.dependencies]
pytest-memray = "*"
[tool.pixi.feature.test.tasks]
tests = "pytest tests"
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.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.mypy.dependencies]
mypy = "*"
pandas-stubs = "*"
matplotlib = "*" # required because of pandas
[tool.pixi.feature.mypy.tasks]
mypy = "mypy src"
# Environments
# --------------------------------------------------------------------------------------
[tool.pixi.environments]
cuda = {features = ["cuda"], solve-group = "cuda"}
mypy = {features = ["mypy"], solve-group = "default"}
test-cpu = {features = ["test"], solve-group = "default"}
test-gpu = {features = ["test", "cuda"], solve-group = "cuda"}
# ======================================================================================
# Ruff configuration
# ======================================================================================
[tool.ruff]
target-version = "py312"
fix = true
line-length = 88
[tool.ruff.lint]
select = ["ALL"]
extend-ignore = [
# missing type annotation
"ANN001",
# missing type annotation for `*args`
"ANN002",
# missing type annotation for `**kwargs`
"ANN003",
# missing return type annotation for public function
"ANN201",
# missing return type annotation for private function
"ANN202",
# No explicit `stacklevel` keyword argument found
"B028",
# In conflict with formatter
"COM812",
# Missing docstring in public module
"D100",
# missing docstring in public function
"D103",
# missing docstring in public package
"D104",
# exception must not use a string literal
"EM101",
# exception must not use an f-string literal
"EM102",
# Boolean default positional argument in function definition
"FBT002",
# line contains a todo
"FIX002",
# In conflict with formatter
"ISC001",
# Leave Numpy's legacy RNG
"NPY002",
# array.at is perfectly valid Jax, but linter thinks it's Pandas...
"PD008",
# pd.merge is fine
"PD015",
# df is just fine
"PD901",
# Many suggestions to use list comprehension are not helpful
"PERF401",
# Magic values are fine
"PLR2004",
# Too many arguments to function call
"PLR0913",
# Assignment before return statement is fine.
"RET504",
# use of `assert` detected
"S101",
# `pickle` module is unsafe
"S301",
# Private member accessed: `_stochastic_info`
"SLF001",
# long messages outside the exception class
"TRY003",
]
[tool.ruff.lint.per-file-ignores]
"src/skillmodels/constraints.py" = ["D417"]
"src/skillmodels/decorators.py" = ["D417"]
"src/skillmodels/kalman_filters.py" = ["D417"]
"src/skillmodels/likelihood_function.py" = ["D417"]
"src/skillmodels/likelihood_function_debug.py" = ["D417"]
"src/skillmodels/params_index.py" = ["D417"]
"src/skillmodels/parse_params.py" = ["D417"]
"src/skillmodels/process_data.py" = ["D417"]
"src/skillmodels/simulate_data.py" = ["D417"]
"src/skillmodels/visualize_*.py" = ["BLE001", "D417"]
"src/skillmodels/*_heatmap*.py" = ["D417"]
"tests/*" = ["ARG001", "FBT003", "INP001", "PD002", "NPY002", "PTH123", "S506"]
"**/*.ipynb" = ["B018", "T201", "E402", "PLR2004", "INP001", "PTH100"]
"docs/**/*" = ["A001", "ERA001", "INP001", "PTH100", "PTH123", "S506"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.pytest.ini_options]
markers = [
"wip: Tests that are work-in-progress.",
"unit: Flag for unit tests which target mainly a single function.",
"integration: Flag for integration tests which may comprise of multiple unit tests.",
"end_to_end: Flag for tests that cover the whole program.",
]
norecursedirs = ["docs", ".envs"]
# ======================================================================================
# yamlfix configuration
# ======================================================================================
[tool.yamlfix]
line_length = 88
sequence_style = "block_style"
none_representation = "null"
# ======================================================================================
# mypy configuration
# ======================================================================================
[[tool.mypy.overrides]]
module = ["dags", "dags.signature"]
ignore_missing_imports = true