Skip to content

Commit 9575fc8

Browse files
authored
Merge branch 'master' into quantreg
2 parents 33f57bb + a3236f6 commit 9575fc8

34 files changed

+5232
-1148
lines changed

.all-contributorsrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,24 @@
315315
"contributions": [
316316
"doc"
317317
]
318+
},
319+
{
320+
"login": "JaapCTJ",
321+
"name": "JaapCTJ",
322+
"avatar_url": "https://avatars.githubusercontent.com/u/157970664?v=4",
323+
"profile": "https://github.com/JaapCTJ",
324+
"contributions": [
325+
"code"
326+
]
327+
},
328+
{
329+
"login": "shapiromh",
330+
"name": "Matt Shapiro",
331+
"avatar_url": "https://avatars.githubusercontent.com/u/2327833?v=4",
332+
"profile": "http://shapiromh.com",
333+
"contributions": [
334+
"code"
335+
]
318336
}
319337
],
320338
"contributorsPerLine": 8,

.github/workflows/ci-tests.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
run: |
4747
R_LIB_PATH="${{ github.workspace }}/.pixi/envs/dev/lib/R/library"
4848
mkdir -p $R_LIB_PATH
49-
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages(c('fixest', 'broom','did2s', 'wildrwolf', 'ivDiag', 'car'), lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library')"
49+
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages(c('did2s', 'wildrwolf', 'ivDiag'), lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library', repos = c('https://cran.rstudio.com', 'https://s3alfisc.r-universe.dev'))"
5050
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages('ritest', lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library', repos = c('https://grantmcdermott.r-universe.dev'))"
5151
- name: Run 'regular' tests
5252
run: |
@@ -94,11 +94,12 @@ jobs:
9494
run: |
9595
R_LIB_PATH="${{ github.workspace }}/.pixi/envs/dev/lib/R/library"
9696
mkdir -p $R_LIB_PATH
97-
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages(c('fixest', 'broom','did2s', 'wildrwolf', 'ivDiag', 'car'), lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library')"
97+
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages(c('did2s', 'wildrwolf', 'ivDiag'), lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library', repos = c('https://cran.rstudio.com', 'https://s3alfisc.r-universe.dev'))"
9898
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages('ritest', lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library', repos = c('https://grantmcdermott.r-universe.dev'))"
9999
- name: Run tests against r
100100
run: |
101-
pixi run tests-against-r
101+
pixi run tests-against-r-core
102+
pixi run tests-against-r-extended
102103
103104
- name: Upload coverage to Codecov (partial)
104105
uses: codecov/codecov-action@v4

.github/workflows/extended_tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ jobs:
4444
run: |
4545
R_LIB_PATH="${{ github.workspace }}/.pixi/envs/dev/lib/R/library"
4646
mkdir -p $R_LIB_PATH
47-
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages(c('fixest', 'broom','did2s', 'wildrwolf', 'ivDiag', 'car'), lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library')"
47+
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages(c('did2s', 'wildrwolf', 'ivDiag'), lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library', repos = c('https://cran.rstudio.com', 'https://s3alfisc.r-universe.dev'))"
4848
Rscript -e ".libPaths('$R_LIB_PATH'); install.packages('ritest', lib='/home/runner/work/pyfixest/pyfixest/.pixi/envs/dev/lib/R/library', repos = c('https://grantmcdermott.r-universe.dev'))"
4949
- name: Run long tests with coverage
50-
run: pixi r tests-extended
50+
run: pixi run tests-extended
5151

5252
- name: Upload coverage to Codecov (partial)
5353
uses: codecov/codecov-action@v4

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
args: ["--verbose"]
2121

2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: v0.11.8
23+
rev: v0.11.10
2424
hooks:
2525
- id: ruff
2626
args: ["--fix", "--output-format=full"]

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ Thanks goes to these wonderful people:
280280
</tr>
281281
<tr>
282282
<td align="center" valign="top" width="12.5%"><a href="https://github.com/jestover"><img src="https://avatars.githubusercontent.com/u/11298484?v=4?s=100" width="100px;" alt="Joseph Stover"/><br /><sub><b>Joseph Stover</b></sub></a><br /><a href="https://github.com/py-econometrics/pyfixest/commits?author=jestover" title="Documentation">📖</a></td>
283+
<td align="center" valign="top" width="12.5%"><a href="https://github.com/JaapCTJ"><img src="https://avatars.githubusercontent.com/u/157970664?v=4?s=100" width="100px;" alt="JaapCTJ"/><br /><sub><b>JaapCTJ</b></sub></a><br /><a href="https://github.com/py-econometrics/pyfixest/commits?author=JaapCTJ" title="Code">💻</a></td>
284+
<td align="center" valign="top" width="12.5%"><a href="http://shapiromh.com"><img src="https://avatars.githubusercontent.com/u/2327833?v=4?s=100" width="100px;" alt="Matt Shapiro"/><br /><sub><b>Matt Shapiro</b></sub></a><br /><a href="https://github.com/py-econometrics/pyfixest/commits?author=shapiromh" title="Code">💻</a></td>
283285
</tr>
284286
</tbody>
285287
</table>

docs/_quarto.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ website:
4747
text: "On Small Sample Corrections"
4848
- text: "Compare fixest & PyFixest"
4949
file: compare-fixest-pyfixest.qmd
50+
- text: "Compare Stata & PyFixest"
51+
file: stata-2-pyfixest.qmd
5052
- text: "PyFixest on the GPU"
5153
file: pyfixest_gpu.ipynb
5254
- text: "Replicating 'The Effect' with PyFixest"

docs/contributing.qmd

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,17 @@ pixi run lint
9090

9191
and you're ready to go! After installation, the task will run all linting rules via `ruff`.
9292

93-
We’ve included other tasks to help install the necessary R packages for running unit tests or to run different sets of tests:
93+
We’ve included other tasks to help with testing. Almost all the necessary dependencies to run tests are included in the dev environment,
94+
except for R packages unavailable through conda-forge.
9495
```{.bash .code-copy}
95-
# install all R development dependencies
96-
pixi run install-r
96+
# attempt to install non-conda R dependencies
97+
pixi run install-r-extended
9798
# run all tests via pytest
9899
pixi run tests
99-
# run all tests excluding very computationally demanding tests
100+
# run all tests excluding very computationally demanding tests or R-based tests
100101
pixi run tests-regular
102+
# run all tests that depend on the extra R dependencies
103+
pixi run tests-against-r-extended
101104
# rerun failed tests
102105
pixi run tests-rerun
103106
```
@@ -132,26 +135,10 @@ winget install -e --id Python.Python.3.11
132135

133136
### Installing R
134137

135-
Note that installing R and the R packages listed below is only necessary if you want to test against R in your local installation.
136-
You can also test against R by using github actions.
138+
Note that R and R dependencies available through conda-forge are installed by pixi to the local project if you use the dev environment.
139+
Some extra R dependencies may require additional development tools not included in the environment, for example:
137140

138-
On Mac/Linux:
139-
```{.bash .code-copy}
140-
brew install r
141-
```
142-
143-
Depending on your local set up, you may need to install additional libraries, for
144-
example:
145-
146-
```{.bash .code-copy}
147-
sudo apt install gcc-11 cmake
148-
```
149-
150-
On Windows using [Winget](https://winget.run/pkg/RProject/R):
151-
152-
```{.bash .code-copy}
153-
winget install -e --id RProject.R
154-
```
141+
Depending on your local set up, you may need to install additional libraries to compile those extra dependencies, like a version of `gcc` and `cmake`.
155142

156143
### Installing Quarto
157144

docs/stata-2-pyfixest.qmd

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ econmetrics in Python you might check out Arthur Turrell's
1818
which includes a section on
1919
[Coming from Stata](https://aeturrell.github.io/coding-for-economists/coming-from-stata.html),
2020
or [Tidy Finance with Python](https://www.tidy-finance.org/python/) by Christopher
21-
Scheuch, Stefan Voigt, Patrick Weiss, and Christoph Frey.
21+
Scheuch, Stefan Voigt, Patrick Weiss, and Christoph Frey. You can also check out the fixest section
22+
of [stata2r](https://stata2r.github.io/fixest/) as there is a lot of overlap between fixest and PyFixest
23+
syntax.
2224

2325
# Data
2426

@@ -32,14 +34,14 @@ df = pf.get_data()
3234
If you want to use the same dataset in Stata, you can save the data to your home
3335
directory as a .dta file with
3436

35-
```{python}
37+
```{python, eval = FALSE}
3638
import os
3739
df.to_stata(os.path.join(os.path.expanduser("~"), "pyfixest-data.dta"))
3840
```
3941

4042
and then load the data in Stata with
4143

42-
```{stata}
44+
```stata
4345
cd ~
4446
use pyfixest-data.dta
4547
```
@@ -55,7 +57,7 @@ fit2 = pf.feols("Y ~ X1 + X2", data = df)
5557

5658
which is equivalent to
5759

58-
```{stata}
60+
```stata
5961
reg Y X1
6062
6163
* Source | SS df MS Number of obs = 998
@@ -131,7 +133,7 @@ fit3.summary()
131133

132134
which is equivalent to
133135

134-
```{stata}
136+
```stata
135137
reg Y X1 X2, robust
136138
137139
* Linear regression Number of obs = 998
@@ -152,7 +154,7 @@ reg Y X1 X2, robust
152154

153155
or
154156

155-
```{stata}
157+
```stata
156158
reg Y X1 X2, vce(robust)
157159
158160
* Identical output to above
@@ -167,7 +169,7 @@ fit4.summary()
167169

168170
Note: This will not exactly match the output of the equivalent Stata command, which is
169171

170-
```{stata}
172+
```stata
171173
reg Y X1 X2, vce(hc3)
172174
173175
* Linear regression Number of obs = 998
@@ -210,7 +212,7 @@ fit6.summary()
210212

211213
which is equivalent to
212214

213-
```{stata}
215+
```stata
214216
reg Y X1 X2, vce(cluster f1)
215217
216218
* Linear regression Number of obs = 997
@@ -246,7 +248,7 @@ fit7.summary()
246248

247249
Note: This will not exactly match the output of the equivalent Stata command, which is
248250

249-
```{stata}
251+
```stata
250252
reg Y X1 X2, vce(cluster f1 f2)
251253
252254
* Linear regression Number of obs = 997
@@ -298,7 +300,7 @@ fit9.summary()
298300

299301
which is equivalent to
300302

301-
```{stata}
303+
```stata
302304
xtset f1
303305
xtreg Y X1 X2, fe
304306
@@ -329,7 +331,7 @@ xtreg Y X1 X2, fe
329331

330332
or
331333

332-
```{stata}
334+
```stata
333335
reghdfe Y X1 X2, absorb(f1)
334336
335337
* HDFE Linear regression Number of obs = 997
@@ -366,7 +368,7 @@ fit10.summary()
366368

367369
is equivalent to
368370

369-
```{stata}
371+
```stata
370372
xtset f1
371373
xtreg Y X1 X2, fe vce(cluster f1)
372374
@@ -398,7 +400,7 @@ xtreg Y X1 X2, fe vce(cluster f1)
398400

399401
or
400402

401-
```{stata}
403+
```stata
402404
reghdfe Y X1 X2, absorb(f1) cluster(f1)
403405
404406
* HDFE Linear regression Number of obs = 997
@@ -437,7 +439,7 @@ fit11.summary()
437439

438440
which is equivalent to
439441

440-
```{stata}
442+
```stata
441443
reghdfe Y X1 X2, absorb(f1 f2) cluster(f1)
442444
443445
* HDFE Linear regression Number of obs = 997

0 commit comments

Comments
 (0)