-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
276 lines (214 loc) · 7.31 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
# ======================================================================================
# Project metadata
# ======================================================================================
[project]
name = "lcm"
description = "lcm aims to generalize and facilitate the specification, solving, and estimation of dynamic choice models."
requires-python = ">=3.12"
dependencies = [
"dags",
"numpy",
"pandas",
]
dynamic = ["version"]
keywords = [
"Dynamic programming",
"Econometrics",
"Economics",
"Estimation",
"Life cycle models",
"Statistics",
]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering",
]
authors = [
{ name = "Tim Mensinger", email = "[email protected]" },
{ name = "Janos Gabler" },
]
maintainers = [
{ name = "Tim Mensinger", email = "[email protected]" },
{ name = "Hans-Martin von Gaudecker", email = "[email protected]" },
]
[project.readme]
file = "README.md"
content-type = "text/markdown"
[project.license]
file = "LICENSE"
[project.urls]
Repository = "https://github.com/opensourceeconomics/lcm"
Github = "https://github.com/opensourceeconomics/lcm"
Tracker = "https://github.com/OpenSourceEconomics/lcm/issues"
# ======================================================================================
# Build system configuration
# ======================================================================================
[build-system]
requires = ["hatchling", "hatch_vcs"]
build-backend = "hatchling.build"
[tool.hatch.build.hooks.vcs]
version-file = "src/lcm/_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]
python = "3.12"
scipy = "<=1.13"
pybaum = "*"
jupyterlab = "*"
plotly = ">=5.24,<6"
pre-commit = "*"
snakeviz = "*"
memory_profiler = "*"
[tool.pixi.target.unix.dependencies]
jax = ">=0.4.34"
jaxlib = ">=0.4.34"
# Development Dependencies (pypi)
# --------------------------------------------------------------------------------------
[tool.pixi.pypi-dependencies]
lcm = {path = ".", editable = true}
pdbp = "*"
[tool.pixi.target.win-64.pypi-dependencies]
jax = { version = ">=0.4.34", extras = ["cpu"] }
jaxlib = ">=0.4.34"
# 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.34"
jaxlib = { version = ">=0.4.34", build = "cuda12*" }
[tool.pixi.feature.test.dependencies]
pytest = "*"
pytest-cov = "*"
pytest-xdist = "*"
[tool.pixi.feature.test.tasks]
tests = "pytest tests"
tests-with-cov = "pytest tests --cov-report=xml --cov=./"
explanation-notebooks = "jupyter execute explanations/*.ipynb"
[tool.pixi.feature.mypy.dependencies]
mypy = ">=1.11.2"
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
exclude = ["src/lcm/sandbox"]
[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",
# 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",
# line contains a todo
"FIX002",
# Too many arguments to function call
"PLR0913",
# use of `assert` detected
"S101",
# `pickle` module is unsafe
"S301",
# Private member accessed: `_stochastic_info`
"SLF001",
# Use `contextlib.suppress(ImportError)` instead of `try`-`except`-`pass`
"SIM105",
# long messages outside the exception class
"TRY003",
# Missing docstring in magic method
"D105",
# Rules ignored to avoid conflict with formatter
# ----------------------------------------------------------------------------------
"COM812",
"ISC001",
]
[tool.ruff.lint.per-file-ignores]
"docs/source/conf.py" = ["E501", "ERA001", "DTZ005"]
"tests/*" = ["PLR2004", "D101"]
"examples/*" = ["INP001", "D101"]
"explanations/*" = ["INP001", "B018", "T201", "E402", "PD008"]
"scripts/*" = ["INP001", "D101", "RET503"]
"**/*.ipynb" = ["FBT003", "E402", "D101"]
"src/lcm/ndimage.py" = ["A002"] # Argument `input` is shadowing a Python builtin
[tool.ruff.lint.pydocstyle]
convention = "google"
# ======================================================================================
# Pytest configuration
# ======================================================================================
[tool.pytest.ini_options]
markers = [
"wip: Tests that are work-in-progress.",
"slow: Tests that take a long time to run and are skipped in continuous integration.",
"illustrative: Tests are designed for illustrative purposes",
]
norecursedirs = ["docs", ".envs"]
addopts = ["--pdbcls=pdbp:Pdb"]
# ======================================================================================
# yamlfix configuration
# ======================================================================================
[tool.yamlfix]
line_length = 88
sequence_style = "block_style"
none_representation = "null"
# ======================================================================================
# mypy configuration
# ======================================================================================
[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_defs = false
ignore_errors = true
[[tool.mypy.overrides]]
module = ["dags", "dags.signature", "pybaum", "pdbp"]
ignore_missing_imports = true