Repository navigation
Releases
v0.5.1 - bug fix release
Bug fix release. Every fix ships with a test that was watched failing first.
Fixed
Wrong duality gap tolerance in the preprocessing path. fit() passed the preprocessing parameters positionally into a signature that takes eps first, so every argument landed one position early: the duality gap tolerance became 0.8 instead of 1e-6, Mm_factor became 3, and max_bad_fixup became 1e-6, which let the residual fix-up loop run at most once. The loose stopping rule silently returned a coarser solution, off by 2.7e-3 from the optimum where the corrected call is within 5e-8. This affects fit_method="preproc-ipm" and the automatic path for n >= 100000.
Hang on rank deficient design matrices. The solver factorizes X'X with a Cholesky decomposition and never checks LAPACK's info flag, so a collinear design either produced NaN coefficients, which the retry loop then chased forever by widening the tolerance, or coefficients of order 1e12 that were returned as an estimate. A dummy variable trap is an easy way to hit this. Both cases now raise LinAlgError, and the retry loop gives up after ten relaxations instead of looping without bound.
Uninitialized memory returned by invnormal outside (0, 1). _invnormal assigns its result in three branches that all require 0 < p < 1, so any other argument returned whatever was on the stack, for instance 6.95e-310 at p = 0 instead of -inf. cluster_cov reaches this through invnormal(theta ± h_nG) at extreme quantiles. It now returns -inf, +inf or NaN.
Out of bounds write in matrix_opaccum. The accumulator requires the rows of a group to be contiguous and writes one group boundary per group into a buffer of exactly G ints, but neither requirement was checked. Unsorted group labels silently returned a matrix that is not the sum over the clusters, and because a boundary is written for every run of equal labels, they also wrote past the end of that buffer, corrupting the heap. Both cases now raise ValueError. cluster_cov sorts before calling and was not affected.
Missing gaussian kernel. kernel="gau" is accepted by the validation and named in its own error message, but had no implementation, so it failed with KeyError: 'gau'.
Unknown fit_method silently ignored. A misspelled method skipped coefficient estimation entirely and surfaced later as AttributeError: 'QuantReg' object has no attribute 'params'. It now raises ValueError.
Tests
The suite grew from 6 tests to 23. The Python layer had no coverage at all before this release; QuantReg.fit, the preprocessing path, and cluster_cov are now covered, with statsmodels used as an independent oracle for the covariance estimators.
Full changelog: v0.5.0...v0.5.1
v0.5.0 - first release of the pyqreg2 fork
First release of this maintained fork of mozjay0619/pyqreg.
Published on PyPI as pyqreg2, but the import name is still pyqreg, so it is a drop-in replacement:
pip install pyqreg2
import pyqreg # unchanged
Do not install pyqreg and pyqreg2 at the same time: both provide the same pyqreg import package. Run pip uninstall pyqreg first.
What's changed
Compatibility
- Support for Python 3.11-3.13, NumPy 2.x and recent SciPy.
- Prebuilt wheels for Linux (x86_64, aarch64), macOS (Intel, Apple Silicon) and Windows, so a compiler is no longer needed to install.
Packaging fixes
- Declare the runtime dependencies. NumPy, SciPy, pandas and patsy were only listed as development extras, so a plain install failed with an ImportError.
- Ship the Cython sources in the sdist. It previously contained generated
.cfiles that are not tracked in git, and none of the.pyx/.pxdsources, making it unbuildable from a clean checkout.
Maintenance
- Replace the retired CircleCI setup with GitHub Actions: linting and tests on Linux, macOS and Windows across Python 3.11-3.13, and releases gated on those checks.
- Relax an over-strict tolerance in the
fit_coefstest that failed on Apple Silicon, where the Accelerate BLAS differs from OpenBLAS on a deliberately degenerate problem. - Adopt ruff, replace bare
Exceptionraises withValueError, and fix a mutable default argument.
All credit for the original implementation goes to Jay Kim. This fork keeps the original BSD 3-Clause license.