Skip to main content

fitwise

One call. One fit. One report you can trust.

Tests PyPI License: BSD-3-Clause

Status: alpha (0.2). Fitting, built-in and text models, automatic starting values, robust fits, report, plot and export work and are tested against the NIST reference data. The API may still change before 1.0. Documentation: https://maroba.github.io/fitwise/

fitwise is an ergonomic layer over lmfit and scipy for curve fitting in the lab. It brings no new solver of its own. Instead it makes the existing ones fast to use and hard to misuse:

import fitwise as fw

result = fw.fit(fw.models.gaussian, x, y, yerr=dy)
print(result)              # report: parameters ± errors, χ²/ndf, R², correlations, warnings
result.plot()              # data, fit, confidence band, residuals
result.params["sigma"]     # value, uncertainty, unit

What it does for you

  • Picks the solver: direct linear least squares when the model is linear in its parameters, Levenberg–Marquardt otherwise, and orthogonal distance regression when xerr is given.
  • Finds starting values, including for your own functions and for models written as text (fw.fit("a*exp(-x/tau) + c", x, y)), and shows how it found them.
  • Resists outliers on request: loss="huber" downweights them and marks them in the plot.
  • Gives honest uncertainties: a documented covariance convention, confidence and prediction bands, and bootstrap or profile likelihood on request.
  • Warns instead of returning wrong numbers: non-convergence, parameters at a bound, poor χ²/ndf and strong correlations all show up in the report.
  • Makes fits reproducible: result.to_dict() captures everything needed to repeat the fit.

Installation

pip install fitwise            # core: numpy, scipy, lmfit
pip install "fitwise[all]"     # + plotting, ODR, units, symbolic models, batch fits

Development

uv sync --all-extras           # create .venv with all extras and dev tools
uv run pre-commit install
uv run pytest                  # fast tests
uv run pytest -m nist          # NIST StRD reference suite

License

BSD-3-Clause

Metadata

Release files for fitwise 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fitwise 0.2.0
File Size Uploaded Provenance
fitwise-0.2.0.tar.gz 93.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for fitwise 0.2.0
File Interpreter ABI Platform
fitwise-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 144.5 kB

Release files / fitwise-0.2.0.tar.gz

Download URL fitwise-0.2.0.tar.gz
Size 93.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a90966f4a42e10fcb9a281f9cceef943dcb4964380a4ef04952e4509e75b6fed
BLAKE2b-256 checksum
How to use checksums
58c611baa8764364734f8eccfdf72abea682e6c97d0eb40c8be61b27f81026bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Release files / fitwise-0.2.0-py3-none-any.whl

Download URL fitwise-0.2.0-py3-none-any.whl
Size 50.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6ef220acd8cab64642ee9725e79796f6cbf8380f491b6b70e8c572822cfc59b
BLAKE2b-256 checksum
How to use checksums
38786835bb5ffb83045b7bc067a871615a125dc0ae4293a613807805d2a1c92d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

Security for fitwise 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fitwise-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page