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.
  • instruments — Keysight 34401A (resistance + DCV, auto-ranged), DSO7012A dual-cursor, ruler/caliper/micrometer, reading_lsd, column_lsd.
  • 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.1.0.tar.gz (20.2 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.1.0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for taulab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3635b9bb91bda8e66424fb59672fa4636ce4710aed985dce335140bfa85bd412
MD5 ea97a955e583c82303583917dbfecbbc
BLAKE2b-256 3d8123963ea08dc112f12f345a5343bb53b6dda9dcccebf09d9fdb9f358a29bc

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for taulab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c934d1656d9e39dd7907b8ca0358e32e206b4a26afb65ee58bd695f1d9195938
MD5 6e40699c7774337123306a5a9f5e47af
BLAKE2b-256 112b503e6b5361651a4c177a50c4192a92888c9812e0e4e91ec307df8f286641

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