Skip to main content

TAU physics-lab helpers for marimo notebooks

Project description

taulab

Physics-lab helpers for TAU coursework, built for marimo notebooks.

A rewrite of itayf-tau/taulab with uncertainty-propagating arithmetic, a stock instrument-uncertainty library (Keysight 34401A, DSO7012A, ruler/caliper), auto-seeded ODR, confidence-band plotting, and marimo-native display helpers.

Install

pip install taulab              # core
pip install taulab[marimo]      # + marimo display helpers

Quick example

import numpy as np
from taulab import fit_functions, odr_fit, Graph

x  = np.linspace(0, 1, 10)
y  = 2 * x + 1 + 0.02 * np.random.default_rng(0).standard_normal(10)
sx = np.full_like(x, 0.01)
sy = np.full_like(y, 0.02)

# Auto-seeded linear ODR — no init_values needed
res = odr_fit(fit_functions.linear, None, x, sx, y, sy,
              param_names=["intercept", "slope"])
print(res)                                              # metrics + params

fig, _ = Graph(res).plot_with_residuals(show_band=True)

In a marimo cell:

from taulab.display import fit_callout, params_table
mo.vstack([fit_callout(res), params_table(res, show_correlation=True)])

Highlights over upstream

  • Uncertainty arithmetic on PhysicalSize via the uncertainties package.
  • statsresolution_sigma, sem, combine, weighted_mean, nsigma, drop_outliers.
  • ODR auto-seeded for linear / polynomial / constant fits.
  • FitResultcov, correlation_matrix, pulls, quality, extrapolate, params_dict.
  • Graph.plot_with_residuals with a 1-σ confidence band from the parameter covariance.
  • display — siunitx LaTeX formatters, fit_callout, params_table, results_table, uncertainty_budget, fit_metrics_accordion, chi_squared_badge, statistical_assessment_prose.

Full upstream import paths are preserved: from taulab.fit import odr_fit, fit_functions and from taulab.parse import parse_csv_folder both work unchanged.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

taulab-0.2.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

taulab-0.2.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file taulab-0.2.0.tar.gz.

File metadata

  • Download URL: taulab-0.2.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for taulab-0.2.0.tar.gz
Algorithm Hash digest
SHA256 26497b654f6728edaa2e84f19e7e074e7d4b565a45a80d6f114122a240ae22ce
MD5 428598cd3bdf5b9be1ecc946e555a046
BLAKE2b-256 3353fa549c915632eadac375b6502c002f53a28c88aa48ad75a604ad026815d1

See more details on using hashes here.

File details

Details for the file taulab-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: taulab-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for taulab-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0d7f95b9e4540e4779e3686132eae7d48c7369a36ee314ee124c9124e1953ab
MD5 f9ea821e820aa7c4579e25dc35206a4f
BLAKE2b-256 aac55cbaa2758e25246dd94978bdf3556d81b717e9bebd91faba98e98081ac20

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page