Ambient project TODOs — things that would be nice to do but are not blocking
any particular release. For items I noticed during the v1.0 modernization
pass and decided to defer, see TODO_DEFERRED.md.
-
figure out a way to automatically add function signatures to docstrings for functions defined in Cython modules
- in the current docstrings, the "def" line has been simply manually copy-pasted into the docstring, causing duplication and potential drift between the signature and its documentation.
-
move
examples/sudoku_lhs.pyinto a separate proper library.
Update the theory PDFs under doc/ so they match the current code and
current understanding:
-
Emphasize surrogate models / response surface modeling. Drop the Taylor-series framing — it is misleading, since it severely overestimates the error. The coefficients come from a weighted least-squares fit, not from analytic differentiation at the origin, and the averaging effect gives much better error behavior than Taylor truncation would predict. See the comment block at the top of
wlsqm/fitter/polyeval.pyxfor the current framing. -
Introduce the weighting factors
w[k]. Change the definition of the total squared errorGto be the weighted total squared error, where each neighbor pointx[k]has its own weightw[k]. The end result is to weight, in each sum over k, each term byw[k]. Seewlsqm/fitter/impl.pyxfor the current implementation. -
Add a section on matrix scaling, which drastically improves the condition number of the problem matrix. Include a short explanation of how the row and column scaling arrays are used in the solve step. Cite the algorithm papers (see
wlsqm/utils/lapackdrivers.pyx, therescale_ruiz2001_ccomment has the full reference: Daniel Ruiz, A Scaling Algorithm to Equilibrate Both Rows and Columns Norms in Matrices, Report RAL-TR-2001-034, 2001). -
Add a section on iterative refinement for roundoff mitigation (this technique is standard in least-squares fitting). The use of FMA in
wlsqm/fitter/polyeval.pyx, used internally to compute the residualerror = data − model, further reduces roundoff because it rounds only the end result ofop1*op2 + op3. -
Combine the three pieces (
wlsqm.pdf,wlsqm_gen.pdf,eulerflow.pdf) into a single document. The current fragmentation dates back to the organic growth of the original FREYA-era writeup.
The documentation pass is a potential arXiv tutorial target.
- Add an option to return the orthogonal matrices
UandVfromsvd_c(), which is currently only useful for computing the 2-norm condition number. Exposing the full decomposition would let downstream code use the driver for more general least-squares problems.
-
Make
wlsqm.fitter.expert.ExpertSolverinstances copyable.- Needs a
copy()method that deep-copies the C-level allocations (re-running the memory-allocation dance). wlsqm.fitter.infrawould need aCase_copy()that copies the struct and all the pointers it holds into fresh buffers.
- Needs a
-
Make
wlsqm.fitter.expert.ExpertSolverinstances picklable. Same C- level story as above. -
Introduce
DTYPE/DTYPE_taliases instead of usingdouble/np.float64directly, to allow compiling a version with complex- number support (Cython's fused types could serve here).
-
More 3D coverage. Extend the test suite with randomly generated SymPy polynomials (seed = 42), differentiated symbolically, fitted at orders 0–4, with all ~34 derivatives compared against the exact result. Target: worst-case error within ~100·machine epsilon for the function value, tightening with lower derivative order.
-
Profile performance. http://stackoverflow.com/questions/28301931/how-to-profile-cython-functions-line-by-line
-
Various small TODOs and FIXMEs in the code (low priority; grep for
TODO/FIXMEin the sources).
-
ExpertSolver: allow interpolating the model to a single point without a memoryview slice. Currently the input must be a memoryview because the general case is non-contiguous; single-point usage should not require the caller to build one. Profile first to check whether the current path is a real bottleneck. -
Reduce duplication between driver mode and expert mode: split
generic_fit_basic_many()and friends into prepare and solve stages, and haveExpertSolvercall the same stages. The driver mode would then be a thin wrapper. Care needed: the driver mode's behavior (a one-shot fit) must stay identical.