Repository navigation
Add a quickstart, a guide to writing models, a comparison with SciPy, and citation instructions to the README and documentation. - #5
Merged
Conversation
Both now have: - A runnable quickstart, which fits a Gaussian to a thousand noisy lines, each starting at the peak of its line, and evaluates the best-fit models on a finer grid. The documentation plots three of them, and the README shows that figure from Read the Docs. - A guide to writing a model, with an exponential decay as the example. The documentation fits it to a hundred decays with bounds and plots the fitted scales against the truth. - The differences from `scipy.optimize.least_squares()`: the Jacobian, noise and priors, bounds, the convergence test, and what isn't supported. - A "Custom models" item in the list of features. - A citation section pointing to `CITATION.cff`, with a BibTeX entry. The Zenodo DOI will be added after the first release. The documentation also lists the functions of the package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PZRXiFhGzzrF87vsFg73B9
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5 +/- ##
=======================================
Coverage 99.61% 99.61%
=======================================
Files 8 8
Lines 782 782
=======================================
Hits 779 779
Misses 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Say that each fit can have its own independent variable, and that the correlation of the noise is shared by every fit. - Add the differences from `scipy.optimize.least_squares()` in model arguments (extra data goes in more columns of `x`), in `chi2` versus `cost`, and in counting accepted steps versus evaluations. - Call the convergence quantity the decrease in chi-squared that a Gauss-Newton step predicts, which is half the square of the Newton decrement, here and in the `tolerance` docstring. `max_iterations` and `iterations` now say they count accepted steps. - Put the note on `cache=False` before the model example, which fails when pasted into the interactive interpreter. - Rename the noise `sigma` of the quickstart to `noise`, since sigma is the width of the Gaussian model, and note the shape of `x`. - Say that the README figure comes from the documentation, and pin its cell first in `index.rst`, since its name depends on the cell order. - Fix the description of the bounds of the exponential example and the grammar of the definition of a model. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PZRXiFhGzzrF87vsFg73B9
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expands the README and the documentation introduction now that
least_squares()has merged (#4), following the layout ofndfilters.Changes
Both the README and
docs/index.rstnow have:...placeholders. The new one fits a Gaussian to a thousand noisy lines and evaluates the best-fit models on a finer grid withndoptimize.evaluate(). Each fit starts at the peak of its own line, which also shows a per-fit initial guess. A shared guess at the center let 2 of the 1,000 lines, the ones 3σ off center, run away. The documentation plots three of the lines with their fits, and the README shows that figure from Read the Docs.@ndoptimize.model, plus a note oncache=Falsefor models defined in the interactive interpreter. The documentation fits it to a hundred decays with bounds and plots the fitted scales against the truth, with error bars.scipy.optimize.least_squares(), like thescipy.ndimagesection ofndfilters. The two find the same minimum for the same objective, as the tests check, but differ in:CITATION.cff, with a BibTeX entry, in the pre-DOI form of colorsynth#24.The documentation also lists what the package provides:
least_squares,evaluate,model/Modelandmodels.Review fixes (8b65ce6)
x, notargs/kwargs;chi2versus SciPy'scost;max_iterationsanditerationscounting accepted steps, not evaluations.tolerancedocstring ofleast_squares()now uses the same wording, and themax_iterationsanditerationsdocstrings say they count accepted steps. This is the PR's only change to the package.cache=Falsenote now comes before the model example, which fails when pasted into the interactive interpreter.noiserather thansigma, since sigma is the width of the Gaussian model, and a comment gives the shape ofx.index.rstcomment keeps that cell first, since the image's name depends on cell order.Checks
Follow-ups
latest(_images/index_0_0.png), so it shows only after this merges andlatestrebuilds.CITATION.cff, the README badge and the citation sections, as for the other sun-data packages.🤖 Generated with Claude Code
https://claude.ai/code/session_01PZRXiFhGzzrF87vsFg73B9