r/numerical • u/Emergency-Tutor-7 • 4h ago
507 functions in pure standard library, and the 1155x slowdown that comes with it
There is a class of problem where the dependency graph is the problem. You want a Runge-Kutta step, a Gauss-Legendre quadrature rule, a Cholesky factorisation, a symplectic integrator for a Hamiltonian system, and to get any of them you end up with NumPy, SciPy, matplotlib and whatever those pull in, on a machine that may not have a C toolchain. I wrote this library for the case where the thing that has to keep working is the physics, not the wheel.
scientific-computing-system is pure Python with zero runtime dependencies: 34 subpackages plus causal.py and sensitivity.py, 35 public feature modules, exporting 507 names (343 functions, 164 classes). tests/test_readme_surface.py derives those counts from the package itself, so the number in the README cannot drift away from the code.
What is inside, briefly: linear algebra and calculus (cds.math_utils, cds.interpolate with SVD, QR, Cholesky, LU, power iteration), ODE and PDE solvers (cds.diffeq, cds.pde with Euler, RK4, adaptive RK45, implicit stiff methods, symplectic integrators, 1-D heat and wave), quadrature (cds.numerical_integration with trapezoid, Simpson 1/3 and 3/8, Romberg, Gauss-Legendre, adaptive Simpson, 2-D tensor rules), optimisation (gradient, Newton, Adam, Nelder-Mead, annealing), statistics and Bayes (cds.stats, cds.probability, cds.bayes), Monte Carlo, an educational cds.ml, signal processing and wavelets, single and multi-qubit state-vector circuits in cds.quantum, graph algorithms, symbolic modelling with expression trees and LaTeX export in cds.modeling, uncertainty propagation and variance-based sensitivity, units with dimensional compatibility, and a workflow layer with approval gates and hash-based run manifests.
The CLI is a cds command with 13 subcommands: modules, info, version, constants, calc, stats, sample, integrate, hypothesis, prompt, benchmark, plot and dashboard. Two of those are honest caveats rather than features: cds modules prints a curated 26 entries and is not the full catalog, and cds dashboard needs the [dashboard] extra.
The catch is real and the README does not hide it. Pure Python is slow on dense numerics: the committed benchmark artifact records 100x100 matrix multiplication at 0.0696 s against NumPy's 0.000060 s, about 1155x slower. That number comes from one CI run whose platform, CPU and library versions were not recorded, so it is order-of-magnitude rather than a measurement you can compare against your machine.
Install is pip install scientific-computing-system, or npm install -g scientific-computing-system for the Node wrapper. Optional extras exist for plotting ([plot]) and the dashboard, and there are lazy backend adapters in cds.tools that discover NumPy, SciPy, statsmodels, scikit-learn, SymPy or Z3 if you happen to have them, without requiring any of them.
What it does not do: it is not a NumPy replacement and the README says so, the machine-learning module is educational rather than production, and if your workload is dense linear algebra at scale you should reach for the 2.0 build or NumPy. MIT, 2.2.25: https://github.com/Furox-Art/scientific-computing-system




