You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Release v2.0.1: Code quality and Rust backend optimizations
Python improvements:
- Extract shared within-transformation logic to utils.py
- New demean_by_group() for one-way fixed effects demeaning
- New within_transform() for two-way (unit + time) FE transformation
- Reduces code duplication across estimators.py, twfe.py, sun_abraham.py, bacon.py
- Fix DataFrame fragmentation warning by building columns in batch
Rust backend optimizations:
- Use Cholesky factorization for matrix inversion in linalg.rs
- More efficient for symmetric positive-definite matrices (X'X)
- Approximately half the operations of general LU decomposition
- Reduce bootstrap allocations in bootstrap.rs
- Allocate directly into pre-allocated buffer
- Eliminates intermediate Vec<Vec<f64>> -> flatten -> Array2 pattern
- Single allocation instead of two
Version bump: 2.0.0 -> 2.0.1
Copy file name to clipboardExpand all lines: TODO.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Consolidation opportunities for cleaner maintenance:
25
25
26
26
| Duplicate Code | Locations | Notes |
27
27
|---------------|-----------|-------|
28
-
| Within-transformation logic |`estimators.py:217-232`, `estimators.py:787-833`, `bacon.py:567-642`| Extract to utils.py|
28
+
|~~Within-transformation logic~~|~~Multiple files~~| ✅ Extracted to `utils.py` as `demean_by_group()` and `within_transform()` (v2.0.1)|
29
29
| Linear regression helper |`staggered.py:205-240`, `estimators.py:366-408`| Consider consolidation |
30
30
31
31
### Large Module Files
@@ -92,8 +92,8 @@ Enhancements for `honest_did.py`:
92
92
93
93
Deferred from PR #58 code review (can be done post-merge):
94
94
95
-
-[]**Matrix inversion efficiency** (`rust/src/linalg.rs:180-194`): Use Cholesky factorization for symmetric positive-definite matrices instead of column-by-column solve
96
-
-[]**Reduce bootstrap allocations** (`rust/src/bootstrap.rs`): Currently uses `Vec<Vec<f64>>` → flatten → `Array2` which allocates twice. Should allocate directly into ndarray.
95
+
-[x]**Matrix inversion efficiency** (`rust/src/linalg.rs`): ~~Use Cholesky factorization for symmetric positive-definite matrices instead of column-by-column solve~~ (completed in v2.0.1)
96
+
-[x]**Reduce bootstrap allocations** (`rust/src/bootstrap.rs`): ~~Currently uses `Vec<Vec<f64>>` → flatten → `Array2` which allocates twice.~~ Now allocates directly into pre-allocated buffer. (completed in v2.0.1)
97
97
-[ ]**Consider static BLAS linking** (`rust/Cargo.toml`): Currently requires system BLAS libraries. Consider `openblas-static` or `intel-mkl-static` features for easier distribution.
0 commit comments