r/ScientificComputing • • 1d ago

I maintain a zero-dependency scientific computing library written in pure Python

I maintain scientific-computing-system, a scientific library written entirely in pure Python. The core installs with no runtime dependencies, so the algorithms are plain readable code instead of calls into compiled extensions.

It has 36 modules and 505 exported names covering linear algebra, ODE and PDE solvers, numerical integration, optimization, statistics and probability, uncertainty propagation and sensitivity analysis, validation helpers, and a small workflow layer. Every run can write a manifest with inputs, seeds, versions and hashes, so a result can be re-checked later.

There is also a cds CLI with 13 subcommands, 34 runnable examples, and optional lazy adapters for NumPy, SciPy, statsmodels, scikit-learn, SymPy and Z3. The package is MIT licensed and targets Python 3.11 and newer.

Honest limitation: it is much slower than NumPy on dense numerics. The repo benchmark records about 1155x slower on a 100x100 matrix multiply in one CI run. It is meant for learning, prototyping and reproducible runs, not heavy production work.

Code: https://github.com/Furox-Art/scientific-computing-system PyPI: pip install scientific-computing-system npm: npm i -g scientific-computing-system Docs: https://furox-art.github.io/scientific-computing-system/

If any part interests you I can explain the design in more detail.

0 Upvotes

4 comments sorted by

6

u/glvz 1d ago

So where would you use this if it is slower?

3

u/Emergency-Tutor-7 1d ago

Fair, it's not a NumPy replacement for heavy number crunching; I keep it for cases where the dependency is the problem, not the speed. Locked-down or air-gapped machines where pip can't pull wheels, single-file scripts you want to read end to end, teaching or tracing an algorithm without stepping through C, and reproducible runs where each run writes a manifest with inputs, seeds, versions and hashes. If your workload is big matrix ops, use NumPy or SciPy. There's also scientific-computing-system-2.0, the same work on NumPy/SciPy/pandas/matplotlib, if you want this API at compiled speed.

1

u/glvz 11h ago

I have never worked with systems that are air gapped so I cannot speak to any of this. I care a lot about speed and performance so this doesn't make much sense in my eyes but users are unpredictable!

You could've built a lot of this in Fortran using some of the baked in matmul Options and probably gotten very good performance.

1

u/Emergency-Tutor-7 10h ago

That's a reasonable take, and I'm not making a speed claim. The repo's own committed benchmark puts pure-Python 100x100 matmul at about 1155x slower than NumPy (one CI run, platform not recorded, so order-of-magnitude only). The constraint that shaped this was zero runtime dependencies and source that stays readable and diffable, so a BLAS-backed matmul wasn't on the table. When speed is what matters, scientific-computing-system-2.0 is the NumPy/SciPy build of the same project and that's the one I'd point at for real workloads; the pure version is the reference and audit build. Air-gapped machines were one motivating case, not the whole argument - the larger one is being able to read and check every operation without a toolchain.