| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2025-03-17 | 5.5 kB | |
| Release v1.2.0 source code.tar.gz | 2025-03-17 | 524.1 kB | |
| Release v1.2.0 source code.zip | 2025-03-17 | 616.3 kB | |
| Totals: 3 Items | 1.1 MB | 0 | |
Version 1.2.0 (2025-03-17)
This is a minor version with new features, bug fixes, deprecations, and documentation improvements.
New Features
- Added the locally symmetric reweighted penalized least squares (
lsrpls) Whittaker smoothing algorithm and its penalized spline versionpspline_lsrpls. - Added the Bayesian reweighted penalized least squares (
brpls) Whittaker smoothing algorithm and its penalized spline versionpspline_brpls. - Added the 4S peak filling (
peak_filling) algorithm, which truncates the data and then iteratively selects the minimum of a directional moving average and the current data point. BaselineandBaseline2Dobjects keep the computed pseudo-inverse of the Vandermonde for polynomial methods if weights are not given, which speeds up most polynomial methods for repeated fits.
Bug Fixes
- All methods of
BaselineandBaseline2Dare now thread-safe as long as non-data arguments are the same for each method call. - Fixed incorrect indexing in
rubberband. - Removed using
copy=Falsefor numpy.array calls since it raised an error in Numpy versions 2.0 or later if a copy had to be made. - Fixed an issue converting sparse matrices to banded matrices when solving penalized splines where a column could be omitted if the last diagonal value was zero. Only relevant if Numba is not installed and using SciPy versions 1.15 and newer.
- Corrected
airplsweighting; the weighting equation for airpls was misprinted in its journal article, so changed to the correct weighting scheme. - Improved overflow avoidance for
iarpls,airpls, anddrpls. - Removed internal parallel processing for
loesssince it was problematic for both threaded and multiprocessing uses. - Fixed an issue when flattening 3D arrays with shape (N, M, 1) to (N, M) where the shape would be output instead of the flattened array.
Other Changes
- Officially list Python 3.13 as supported, as well as the experimental free-threaded Python 3.13 build.
- Updated lowest supported Python version to 3.9
- Updated lowest supported dependency versions: NumPy 1.20, SciPy 1.6, pentapy 1.1, and Numba 0.53
- Allow inputting
assymetric_coefforasplsandpspline_asplsto modify shape of the weighting curve. - Added
normalize_weightsforairplsto normalize weights between 0 and 1, which is set to True by default. The new, correctedairplsweighting makes all negative residuals have weights greater than 1, so this option can help to avoid numerical issues or overflow. Set to False to ensure matching the literature implementation.
Deprecations/Breaking Changes
- All optimizer algorithms other than
Baseline2D.individual_axesnow return the parameter dictionary from the underlying method within themethod_paramskey in order to avoid key overlap between the optimizer's parameters and the method parameters. - The default
deltaforloesswas changed from 0 to0.01 * (max(x_data) - min(x_data)). - The
deltaparameter forloessis now used on the actual inputx_datarather than thex_dataafter scaling to the domain [-1, 1] to make it easier to use. - The
optimal_parameterkey for theoptimize_extended_rangemethod no longer returns the log10 of the optimal value when fitting a non polynomial method. For example, it now returns 10000 rather than 4 if the optimallamvalue was 10000. - Deprecated passing
tolandmax_itertomplsandpspline_mplssince the keywords were not internally used. The keywords will be removed in version 1.4. - Deprecated the
pentapy_solverattribute ofBaselineandBaseline2Din favor of thebanded_solverattribute to control the solvers used for banded linear systems. The attribute will be removed in version 1.4. - Deprecated passing additional keyword arguments for padding to multiple methods, and will remove
the functionality in version 1.4. Keyword arguments for padding should now be grouped into
the
pad_kwargsparameter instead. - Deprecated passing additional keyword arguments for estimating the half-window parameter if none was
given for morphological methods, and will remove the functionality in version 1.4. Keyword arguments
for estimating the half-window should now be grouped into the
window_kwargsparameter instead. - Deprecated the
min_rmsekey from the parameter dictionary output ofoptimize_extended_rangein favor of returning all calculated root mean square values from the fittings through the newrmsekey. Themin_rmsekey will be removed in version 1.4. - Pending Deprecation: The functional interface of pybaselines will be deprecated in version 1.3, and
will be removed in version 2.0. For example, user code using
whittaker.arpls(...)should migrate toBaseline.arpls(...). The only items that will be kept under the main pybaselines namespace will beBaseline,Baseline2D, andutils.
Documentation/Examples
- Added new examples to the documentation.
- Added a page describing best practices for fitting multiple datasets with pybaselines.
- Render each method on its own page in the documentation.