Skip to content

About

Pure-Python computational science with zero runtime dependencies: linear algebra, ODE/PDE solvers, quadrature, Monte Carlo, statistics, signal processing, quantum simulation, uncertainty quantification, sensitivity analysis, dimensional analysis, and reproducible workflows.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

23 stars

Watchers

1 watching

Forks

Latest commit

 

History

542 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scientific-computing-system

scientific-computing-system

A pure-Python computational science platform for numerical methods, modeling, validation, uncertainty, scientific workflows, dimensional analysis, and reproducible research.

PyPI version npm version Python 3.11+ codecov CI License: MIT Docs GitHub release

Docs · Getting Started · API Reference · Cookbook · Benchmarks · Project · Changelog · Contributing · Security · Code of Conduct · Citation · Paper (JOSS) · Discussions · Issues

I wrote this because NumPy and SciPy are incredible, but they're also 20 years old and carry two decades of design decisions that don't always make sense anymore.

Download counts: PyPI stats

This is a from-scratch rethinking of what scientific computing in Python could look like if we started today. No C extensions, no Fortran legacy, no dependency hell. Just Python, type hints, and algorithms that are actually readable.

The import name is cds (the distribution is scientific-computing-system). The zero-dependency core needs nothing but the standard library. The sibling NumPy build of this work is scientific-computing-system-2.0; related projects are listed in docs/related.md.

Install

Channel Command What you get
PyPI (the library) pip install scientific-computing-system The actual Python package. Zero runtime dependencies. This is what you want.
npm (a launcher shim) npm i -g scientific-computing-system A thin Node wrapper that runs python -m cds. It ships no Python and needs the Python distribution installed so that python -m cds resolves.

At the time of writing (2026-10-30), both registries' latest version is 2.2.21, but their 2.2.x histories differ and the two channels are not equally verifiable:

  • PyPI — carries a PEP 740 provenance attestation (Sigstore-signed, binding the file digest to the publishing workflow). Verified on 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.2.8, 2.2.11, 2.2.12, 2.2.13, 2.2.14, 2.2.15 and 2.2.17 through 2.2.21. The 2.2.7 wheel and sdist return 404 from the per-file provenance endpoint, so "every release since attestations were enabled" would be false; 2.2.16 was never published.
  • npm — carries a Sigstore attestation as of 2.2.3, minted by npm's OIDC trusted publisher (the registry serves both an npm publish attestation and a SLSA provenance v1 bundle for that tarball). 1.0.0 through 2.2.2 predate the publisher registration and have none, so pin 2.2.3 or newer. npm has no 2.2.7, 2.2.8, 2.2.11 or 2.2.16 at all: its 2.2.x line is 2.2.0 through 2.2.6, 2.2.12 through 2.2.15, and 2.2.17 through 2.2.21, so the latest versions match while the histories do not. npm also exposes dist.integrity (sha512), which is a content pin, not proof of origin, and dist.signatures, which is npm's registry transport signature, not build provenance.

Prefer PyPI if you need an attestation for a version older than 2.2.3. SECURITY.md has the per-channel table, the published digests to pin, the commands to verify them, and what to register to close the npm gap.

What's inside

src/cds/ holds 34 subpackages plus causal.py and sensitivity.py. That is 35 public feature modules — the cds CLI entry point is the 36th subpackage — exporting 505 names (342 functions, 163 classes), all pure standard library. tests/test_readme_surface.py derives these numbers from the package, so they cannot drift silently.

Area Modules What you get
Core models cds.core Shared Domain, Hypothesis, HypothesisStatus types
Linear algebra & calculus cds.math_utils, cds.interpolate SVD, QR, Cholesky, LU, power iteration, derivatives, integrals
ODE / PDE cds.diffeq, cds.pde Euler, RK4, adaptive RK45, implicit stiff methods, symplectic integrators; 1-D heat & wave equations
Quadrature cds.numerical_integration Trapezoid, Simpson 1/3 & 3/8, Romberg, Gauss-Legendre, adaptive Simpson, 2-D tensor rules
Optimization cds.optimization Gradient descent, Newton, Adam, Nelder-Mead, annealing, constrained search
Statistics cds.stats, cds.probability, cds.bayes Descriptive stats, regression, t/chi-square/ANOVA, effect sizes, nonparametric ranks, time series, multiple testing, Bayesian conjugate updates
Monte Carlo cds.montecarlo π estimation, Monte-Carlo integration, random walks
Machine learning cds.ml MLP, k-NN, k-means, CART, random forest, boosting, PCA (educational, not production)
Signal processing cds.signals, cds.wavelets DFT/FFT/IFFT, convolution, Butterworth design, STFT, Haar DWT
Quantum cds.quantum Single & multi-qubit state-vector circuits, Bell/GHZ states, entanglement
Graphs cds.graph BFS, DFS, Dijkstra shortest paths, Kruskal MST, topological sort, cycle detection
Scientific domains cds.scientific, cds.genetics, cds.fractals, cds.infotheory Physical constants & formulas, DNA analysis & alignment, fractal sets, entropy/divergence/mutual information
Symbolic modeling cds.modeling Expression trees, symbolic differentiation, LaTeX export, MathModel systems, root finding, fitting
Uncertainty & sensitivity cds.uncertainty, cds.sensitivity Analytic + correlated Monte-Carlo propagation, local & variance-based global sensitivity, identifiability
Validation & causality cds.validation, cds.causal Cross-method checks, drift/OOD reports, assumption-gated causal estimators
Units cds.units SI quantities, conversions, dimensional compatibility checks
Workflow & provenance cds.workflow, cds.provenance Approval-gated orchestration, run manifests, hashes, checkpoints
Data cds.data_analysis, cds.data_io CSV/tabular analysis, streaming I/O, optional HDF5/NetCDF
Knowledge & hypothesis cds.knowledge, cds.hypothesis Concept graphs, research notes, structured hypothesis generation & evaluation
NLP (educational) cds.nlp BPE, embeddings, attention, autograd, MiniGPT
Plotting cds.plot Optional matplotlib helpers ([plot] extra)
Backend adapters cds.tools Lazy discovery for NumPy/SciPy/statsmodels/scikit-learn/SymPy/Z3

The authoritative per-module list is the API reference.

!!! note "cds modules is a curated subset" cds modules prints 26 entries. It is not the full catalog: it omits bayes, causal, core, fractals, genetics, infotheory, interpolate, pde, and wavelets. Use the API reference or src/cds/ for the complete set.

Runnable examples and the dashboard

  • examples/ — 34 runnable scripts and notebooks (32 .py, 2 .ipynb), each self-contained and dependency-free unless noted. Every tutorial page in the docs has a matching example.
  • dashboard/app.py — a Streamlit dashboard: cds dashboard, or pip install "scientific-computing-system[dashboard]".

Quick Start

pip install scientific-computing-system
from cds.math_utils import svd
from cds.diffeq import solve_system
from cds.stats import linear_regression

# 1. SVD — result is an SVDResult, not a tuple
result = svd([[1.0, 2.0], [3.0, 4.0]])
print("singular_values =", [round(v, 6) for v in result.singular_values])


# 2. Damped harmonic oscillator: y'' = -y - 0.1 y'
def rhs(t, y):
    return [y[1], -y[0] - 0.1 * y[1]]


t, y = solve_system(rhs, 0.0, [1.0, 0.0], 50.0, dt=0.01)
print("final t =", round(t[-1], 2), "| final y =", [round(v, 8) for v in y[-1]])

# 3. Least-squares line fit
fit = linear_regression([1.0, 2.0, 3.0, 4.0, 5.0], [2.1, 3.9, 6.2, 7.8, 10.1])
print(f"slope = {fit.slope:.4f} | intercept = {fit.intercept:.4f} | r^2 = {fit.r_squared:.4f}")

Real output (executed verbatim; pasted from an actual run):

singular_values = [5.464986, 0.365966]
final t = 50.0 | final y = [0.07638443, 0.0264785]
slope = 1.9900 | intercept = 0.0500 | r^2 = 0.9973

CLI

The package installs a cds command with 13 subcommands:

Command Purpose
cds --help Full command list
cds modules Curated module catalog (see the caveat above)
cds info Version, module status, health summary
cds version Show the installed version
cds constants Table of physical constants
cds calc <formula> Quick physics calculation (ke, gravity, wave, gas)
cds stats <numbers> Descriptive statistics for a comma-separated list
cds sample <dist> Draw samples from a probability distribution
cds integrate <fn> Integrate a built-in function over [a, b]
cds hypothesis <q> Generate scientific hypotheses for a question
cds prompt Prompt text for a custom hypothesis generator
cds benchmark Run the built-in benchmarks
cds plot <numbers> ASCII plot, or PNG with --file when [plot] is installed
cds dashboard Launch the Streamlit dashboard (needs [dashboard])
$ cds --version
System version 2.2.22
$ cds constants        # physical constants table

Optional extras

The core is zero-dependency. Everything below is opt-in:

pip install "scientific-computing-system[scientific]"  # NumPy, SciPy, statsmodels, scikit-learn, SymPy, Z3
pip install "scientific-computing-system[io]"          # HDF5 + NetCDF
pip install "scientific-computing-system[plot]"        # matplotlib
pip install "scientific-computing-system[pandas]"      # DataFrame bridge: cds.data_analysis.pandas_io
pip install "scientific-computing-system[dashboard]"   # Streamlit dashboard

The catch

Pure Python is slower than NumPy on dense numerics: the committed benchmark artifact records 100×100 matrix multiplication at 0.0696 s against NumPy's 0.000060 s, about 1155× slower. Those numbers are from one CI run whose platform, CPU, and library versions were not recorded, so treat them as order-of-magnitude only — docs/benchmarks.md states exactly what that artifact does and does not support, and docs/why-pure-python.md covers when to reach for NumPy or the 2.0 build instead.

Contributing

pip install -e ".[dev,test,docs]"   # lint/type, test, and docs tooling
pytest            # CI also enforces 100% blended coverage (statement + branch)
mkdocs serve      # docs at http://127.0.0.1:8000/

.[dev,test,docs] is the smallest environment for the default test suite and the docs. Add .[property] for the Hypothesis invariants, or .[all] for the dashboard, HDF5/NetCDF, plotting and scientific backends together.

Issues and PRs welcome; see CONTRIBUTING.md and CODE_OF_CONDUCT.md.

Related projects

Part of the Furox scientific-computing portfolio: independently versioned projects that pair agent-facing interfaces (MCP servers and Agent Skills) with deterministic, fail-closed verification.

License

MIT — see LICENSE.

Cite via CITATION.cff. codemeta.json carries the same metadata in codemeta form, and paper.md / paper.bib are the JOSS manuscript.

About

Pure-Python computational science with zero runtime dependencies: linear algebra, ODE/PDE solvers, quadrature, Monte Carlo, statistics, signal processing, quantum simulation, uncertainty quantification, sensitivity analysis, dimensional analysis, and reproducible workflows.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

23 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages