Skip to main content

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.10+ 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.

Both channels are published at the same version. They 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.1.
  • npm — carries no attestation; the npmjs.com trusted publisher is not registered yet, so its publish path cannot mint one. npm does expose 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 for anything security-sensitive. 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/ — 35 runnable scripts and notebooks (33 .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 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.2
$ 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]"
pytest            # CI also enforces 100% blended coverage (statement + branch)
mkdocs serve      # docs at http://127.0.0.1:8000/

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

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.

Metadata

Release files for scientific-computing-system 2.2.2

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

Source distribution (sdist)

Source distribution for scientific-computing-system 2.2.2
File Size Uploaded
scientific_computing_system-2.2.2.tar.gz 766.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scientific-computing-system 2.2.2
File Interpreter ABI Platform
scientific_computing_system-2.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.1 MB

Release files / scientific_computing_system-2.2.2.tar.gz

Download URL scientific_computing_system-2.2.2.tar.gz
Size 766.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ccb710efa6b58bd38fd40ec25263aab0dcd56cfaf2e92f046c58d020837ca071
BLAKE2b-256 checksum
How to use checksums
f83744b099475a654719dbc1acf602d1bfed176445a67e05954f47cf6dc12875
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 5, 2026.

Transparency log

Release files / scientific_computing_system-2.2.2-py3-none-any.whl

Download URL scientific_computing_system-2.2.2-py3-none-any.whl
Size 337.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3469a09ae6e70d05e4267ec0b251a9ad69cec30c9f5e55d95263e4b17c9fcc5c
BLAKE2b-256 checksum
How to use checksums
9c7d8da9968efd178e10fc587fea81cd07b4c78cda4f2db0afb9314ee49c23a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 5, 2026.

Transparency log

Release history Release notifications | RSS feed

2.2.7

2 release files

2.2.6

2 release files

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

This release

2.2.2 This release

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.8.0

2 release files

1.7.3

2 release files

1.7.0

2 release files

1.6.2

2 release files

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