Skip to content

Commit fb3b5a7

Browse files
committed
Version change and docs update
1 parent b1c6fdb commit fb3b5a7

34 files changed

Lines changed: 60 additions & 44 deletions

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ All notable changes to RegressionLab are documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.0] - 2026-03-01
9+
10+
### Changed
11+
12+
- **Equation lookups (Performance)**: `get_equation_format_for_function()` and `get_equation_param_names_for_function()` now use O(1) reverse-lookup dicts (`_FUNCTION_TO_EQUATION`, `_FORMAT_TO_FORMULA`) instead of scanning the entire `EQUATIONS` dict on every call. The formula lookup in `generic_fit` also uses the same O(1) dict. Affects every `fit_*` call.
13+
- **Regex compilation (Performance)**: The ~40 regex patterns in `MATH_FUNCTION_REPLACEMENTS` are now pre-compiled at module load (`MATH_FUNCTION_REPLACEMENTS_COMPILED`). `custom_function_evaluator._prepare_formula()` uses the compiled patterns, avoiding recompilation on every custom formula evaluation.
14+
- **Residuals reuse (Performance/Readability)**: In `generic_fit`, `(y - y_fitted) ** 2` is now computed once as `residuals_sq` and reused for both R² and RMSE calculations.
15+
- **Formatting cleanup (Readability)**: In `fitting_utils.py`, nested `.format()` calls for parameter text replaced with direct f-strings; `merge_initial_guess` now uses `zip(computed, override)` instead of `range(len(computed))`.
16+
- **Transform dispatch (Performance/Maintainability)**: `_apply_to_column` in `transforms.py` refactored from a ~200-line if/elif chain to a dispatch dict (`_TRANSFORM_DISPATCH`) mapping transform IDs to small handler functions. Adding a new transform now requires only writing the handler and adding one dict entry.
17+
- **Simplified `_base.py` re-exports (Maintainability)**: `fitting/functions/_base.py` now uses standard `from module import name` imports instead of manual tuple-assignment. Reduces update points when adding new estimators or utilities.
18+
- **Walsh-Hadamard Transform (Performance)**: Replaced the O(n²) dense matrix approach (`scipy.linalg.hadamard(n2)`) with a vectorized in-place Fast Walsh-Hadamard Transform (FWHT) using only NumPy — O(n log n) time, O(n) memory. Removed `scipy.linalg.hadamard` dependency from transforms.
19+
- **3D plot fallback (Performance)**: The nearest-neighbor fallback in `plot_utils.py` (used when scipy is unavailable) now processes grid points in chunks, bounding peak memory to ~10M floats instead of allocating a full `(grid_size² × n_points)` distance matrix.
20+
821
## [1.0.0] - 2026-02-14
922

1023
### Added
@@ -180,6 +193,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
180193

181194
Initial 0.8.x release. See repository history and documentation for features and changes prior to 0.8.1.
182195

196+
[1.1.0]: https://github.com/DOKOS-TAYOS/RegressionLab/compare/v1.0.0...v1.1.0
183197
[1.0.0]: https://github.com/DOKOS-TAYOS/RegressionLab/compare/v0.9.3...v1.0.0
184198
[0.9.3]: https://github.com/DOKOS-TAYOS/RegressionLab/compare/v0.9.2...v0.9.3
185199
[0.9.2]: https://github.com/DOKOS-TAYOS/RegressionLab/compare/v0.9.1...v0.9.2

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
[![Python](https://img.shields.io/badge/Python-3.12+-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/)
1010
[![License](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](LICENSE)
11-
[![Version](https://img.shields.io/badge/version-1.0.0-blue.svg?style=for-the-badge)](https://github.com/DOKOS-TAYOS/RegressionLab)
11+
[![Version](https://img.shields.io/badge/version-1.1.0-blue.svg?style=for-the-badge)](https://github.com/DOKOS-TAYOS/RegressionLab)
1212
[![Streamlit](https://img.shields.io/badge/Streamlit-FF4B4B?style=for-the-badge&logo=streamlit&logoColor=white)](https://regressionlab.streamlit.app/)
1313
[![SciPy](https://img.shields.io/badge/SciPy-8CAAE6?style=for-the-badge&logo=scipy&logoColor=white)](https://scipy.org/)
1414
[![NumPy](https://img.shields.io/badge/NumPy-013243?style=for-the-badge&logo=numpy&logoColor=white)](https://numpy.org/)
@@ -212,7 +212,7 @@ For information about third-party libraries and their licenses, see
212212

213213
<div align="center">
214214

215-
**Version**: 1.0.0 • **Last Updated**: February 2026
215+
**Version**: 1.1.0 • **Last Updated**: February 2026
216216

217217
Made with ❤️ by [Alejandro Mata Ali](https://github.com/DOKOS-TAYOS)
218218

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,6 @@ Documentation should be reviewed and updated:
265265

266266
---
267267

268-
**Documentation Version**: 1.0.0
268+
**Documentation Version**: 1.1.0
269269
**Last Updated**: February 2026
270270
**Maintainer**: Alejandro Mata Ali

docs/api/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Usage remains the same: import from `config` (e.g. `from config import PLOT_CONF
2121
### Application Metadata
2222

2323
```python
24-
__version__ = "1.0.0"
24+
__version__ = "1.1.0"
2525
__author__ = "Alejandro Mata Ali"
2626
__email__ = "alejandro.mata.ali@gmail.com"
2727
```

docs/customization.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ def generic_fit(func, x, y, uy=None, p0=None):
6767
# Calculate fitted values
6868
y_fitted = func(x, *popt)
6969

70-
# Calculate R²
71-
ss_res = np.sum((y - y_fitted) ** 2)
70+
# Calculate R² and RMSE (residuals computed once and reused)
71+
residuals_sq = (y - y_fitted) ** 2
72+
ss_res = np.sum(residuals_sq)
7273
ss_tot = np.sum((y - np.mean(y)) ** 2)
7374
r_squared = 1 - (ss_res / ss_tot)
74-
75+
rmse = float(np.sqrt(np.mean(residuals_sq)))
76+
7577
return popt, y_fitted, r_squared
7678
```
7779

78-
This function is the **single point of control** for the optimization backend.
80+
This function is the **single point of control** for the optimization backend. Equation lookups (`get_equation_format_for_function`, `get_equation_param_names_for_function`) use O(1) reverse dicts built at module load, so there is no performance cost when resolving equations by function name.
7981

8082
## Why Change the Fitting Core?
8183

docs/extending.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ src/
3030
├── fitting/
3131
│ └── functions/
3232
│ ├── __init__.py # Export new fit_* (add to imports and __all__)
33-
│ ├── _base.py # (optional) add estimator here if needed
33+
│ ├── _base.py # Re-exports fitting utils and estimators
3434
│ ├── polynomials.py
3535
│ ├── trigonometric.py
3636
│ ├── inverse.py
@@ -100,7 +100,7 @@ In the same module under `fitting/functions/`, create a fitting wrapper. The wra
100100
- **Signature**: `(data, x_name, y_name, initial_guess_override=None, bounds_override=None)`
101101
- **Return**: Your wrapper can return `(text, y_fitted, equation)` or the full 4-tuple from `generic_fit`: `(text, y_fitted, equation, fit_info)`. R² is included in `text`. Callers (e.g. Streamlit) use the first three values.
102102

103-
Use `get_equation_param_names_for_function('fit_<name>')` and `get_equation_format_for_function('fit_<name>')` so parameter names and the equation format live only in `equations.yaml`. That way you define them once in config.
103+
Use `get_equation_param_names_for_function('fit_<name>')` and `get_equation_format_for_function('fit_<name>')` so parameter names and the equation format live only in `equations.yaml`. That way you define them once in config. These lookups are O(1) via pre-built reverse dicts (`_FUNCTION_TO_EQUATION` in `constants.py`).
104104

105105
#### Basic Template
106106

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ If you need assistance:
103103

104104
---
105105

106-
**Version**: 1.0.0
106+
**Version**: 1.1.0
107107
**Author**: Alejandro Mata Ali
108108
**License**: MIT

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "regressionlab"
7-
version = "1.0.0"
7+
version = "1.1.0"
88
description = "Scientific curve fitting application with GUI"
99
readme = "README.md"
1010
requires-python = ">=3.12"

sphinx-docs/locale/es/LC_MESSAGES/api/index.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#, fuzzy
88
msgid ""
99
msgstr ""
10-
"Project-Id-Version: RegressionLab 1.0.0\n"
10+
"Project-Id-Version: RegressionLab 1.1.0\n"
1111
"Report-Msgid-Bugs-To: \n"
1212
"POT-Creation-Date: 2026-02-14 18:22+0100\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"

sphinx-docs/locale/es/LC_MESSAGES/configuration.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#, fuzzy
88
msgid ""
99
msgstr ""
10-
"Project-Id-Version: RegressionLab 1.0.0\n"
10+
"Project-Id-Version: RegressionLab 1.1.0\n"
1111
"Report-Msgid-Bugs-To: \n"
1212
"POT-Creation-Date: 2026-02-14 18:22+0100\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"

0 commit comments

Comments
 (0)