forked from py-econometrics/pyfixest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
247 lines (215 loc) · 6.28 KB
/
pyproject.toml
File metadata and controls
247 lines (215 loc) · 6.28 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
[project]
name = "pyfixest"
description = "Fast high dimensional fixed effect estimation following syntax of the fixest R package."
requires-python = ">= 3.9"
version = "0.30.2"
authors = [
{ name = "Alexander Fischer", email = "alexander-fischer1801@t-online.de" },
{ name = "Styfen Schär" },
]
readme = "README.md"
license = { text = "MIT" }
dependencies = [
"scipy>=1.6,<1.16",
"formulaic>=1.1.0",
"pandas>=1.1.0",
"numba>=0.58.0",
"seaborn>=0.13.2",
"tabulate>=0.9.0",
"tqdm>=4.0.0",
"great-tables>=0.10.0",
"numpy>=1.25.2",
"narwhals>=1.13.3",
"joblib>=1.4.2,<2",]
[tool.pixi.feature.dev.dependencies]
rpy2 = ">=3.5.11,<4"
pixi-pycharm = ">=0.0.8,<0.0.9"
r = "*"
r-fixest = ">=0.12.1,<0.13"
r-sandwich = ">=3.0_2,<4"
r-broom = ">=1.0.5,<2"
r-car = ">=3.1_2,<4"
r-quantreg = ">=5.0"
[project.optional-dependencies]
dev = [
"pytest>=7.2.0",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.5.0",
"pyhdfe>=0.2.0",
"doubleml==0.7.1",
"wildboottest>=0.3.2",
"ipykernel>=6.29.5,<7",
"duckdb>=1.1.3",
"polars>=1.0.0",
"pyarrow>=14.0",
"jax>=0.4.15",
"jaxlib>=0.4.15",
"pytest-benchmark>=5.1.0,<6"
]
lint = [
"pre-commit==3.6.0",
"ruff>=0.4.0",
"mypy>=1.10.0",
]
build = [
"pip",
"maturin>=1.8.0",
]
plots = [
"lets-plot>=4.0.0",
]
docs = [
"jupyterlab>=4.0.12",
"jupytext==1.16.1",
"watermark==2.4.3",
"wildboottest>=0.3.2",
"causaldata>=0.1.4,<0.2",
"pylatex>=1.4.2,<2",
"marginaleffects>=0.0.10",
"pyarrow>=14.0",
"jax>=0.4.15",
"jaxlib>=0.4.15",
"lets-plot>=4.0.0",
"quartodoc>=0.9.1,<0.10",
]
jax = [
"jax>=0.4.15",
"jaxlib>=0.4.15",
]
[tool.pixi.feature.build.dependencies]
python-build = ">=1.2.2,<2"
[build-system]
requires = ["maturin>=1.8,<2.0"]
build-backend = "maturin"
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64", "win-64", "osx-arm64", "osx-64"]
[tool.pixi.pypi-dependencies]
pyfixest = { path = ".", editable = true }
[tool.pixi.environments]
default = { solve-group = "default" }
dev = { features = ["dev"], solve-group = "default" }
build = { features = ["build"], solve-group = "default" }
lint = { features = ["lint"], solve-group = "default" }
docs = { features = ["docs"], solve-group = "default" }
jax = { features = ["jax"], solve-group = "default" }
plots = { features = ["plots"], solve-group = "default" }
[tool.pixi.feature.dev.tasks]
tests = "pytest -rs -n 4 --cov-report=term tests"
tests-against-r-core = "pytest -rs tests -n 4 -m \"against_r_core\" --cov=pyfixest --cov-report=xml"
tests-against-r-extended = "pytest -rs tests -n 4 -m \"against_r_extended\" --cov=pyfixest --cov-report=xml"
tests-regular = "pytest tests -n 4 -m \"not (extended or against_r_core or against_r_extended or plots)\" --cov=pyfixest --cov-report=xml"
tests-extended = "pytest tests -n 4 -m \"extended\" --cov=pyfixest --cov-report=xml"
tests-fixest = "pytest -rs tests/test_vs_fixest.py -n 4 --cov=pyfixest --cov-report=xml"
tests-plots-dev = "pixi run --environment dev pytest tests/test_plots.py -n 4"
tests-plots = "pixi run --environment plots pytest tests/test_plots.py -n 4"
tests-rerun = "pytest --lf -n 4"
debug = "python pyfixest/debug.py"
update-test-data = "Rscript tests/r_test_comparisons.R"
install-r-extended = "Rscript r_test_requirements.R"
render-notebooks = "python scripts/run_notebooks.py"
[tool.pixi.feature.lint.tasks]
lint = "pre-commit run ruff --all-files"
mypy = "pre-commit run mypy --all-files"
[tool.pixi.feature.build.tasks]
build-pip = 'python -m build .'
maturin-develop = "maturin develop --release --strip"
[tool.pixi.feature.docs.tasks]
docs-build = "quartodoc build --verbose --config docs/_quarto.yml"
docs-render = "quarto render docs"
docs-preview = "quarto preview docs"
[tool.pixi.feature.docs.dependencies]
rpy2 = ">=3.5.11,<4"
r = "*"
r-fixest = ">=0.12.1,<0.13"
r-broom = ">=1.0.5,<2"
[tool.pytest.ini_options]
addopts = [
"-v",
"--strict-markers",
"--strict-config",
"--cov=pyfixest",
"--cov-report=term-missing",
"--color=yes",
]
markers = [
"against_r_core: mark test to be part of the test suite that depends on conda available R modules",
"against_r_extended: mark test to be part of the test suite that depends on other R modules",
"extended: mark test to be part of the extended test suite",
"plots: marks all tests for plotting functionality, tests only triggered when using tag in github issue",
]
filterwarnings = [
"ignore::FutureWarning:rpy2",
"ignore::DeprecationWarning:rpy2",
]
[tool.ruff]
line-length = 88
fix = true
# Assume Python 3.9
target-version = "py39"
[tool.ruff.lint]
# docs: https://docs.astral.sh/ruff/rules/
select = [
"B", # bugbear
"F", # Pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort
"D", # flake8-docstrings
"UP", # pyupgrade
"SIM", # flake8-simplify
"RUF", # ruff,
"TRY", # tryceratops
]
ignore = [
# do not enable if formatting
# docs: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"B028", # No explicit `stacklevel` keyword argument found
"B904", # Better exception handling
"W191", # tab indentation
"E111", # indentation
"E114", # indentation
"E117", # over indented
"D206", # indent with spaces
"D300", # triple single quotes
"E501", # line length regulated by formatter
"D105", # missing docstring in magic method
"D100", # missing docstring in public module
"D104", # missing docstring in public package
"SIM110", # Use all instead of `for` loop
"TRY003", # Avoid specifying long messages outside the exception class
"D205", # 1 blank line required between summary line and description
"W505", # Doc line too long
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["D100", "D103"]
"pyfixest/multcomp.py" = ["D103"]
"pyfixest/summarize.py" = ["D103"]
"pyfixest/visualize.py" = ["D103"]
"scripts/*.py" = ["D103"]
[tool.ruff.lint.pycodestyle]
max-doc-length = 88
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 88
[tool.mypy]
[[tool.mypy.overrides]]
module = [
"pandas.*",
"numpy.*",
"scipy.*",
"numba.*",
"lets_plot.*",
"formulaic.*",
"wildboottest.*",
"tabulate.*",
"joblib.*",
"narwhals.*",
"tqdm.*",
]
ignore_missing_imports = true
[tool.maturin]
module-name = "pyfixest.core._core_impl"
features = ["pyo3/extension-module"]