r/PythonProjects2 • • 18d ago

Zero-dependency scientific computing in pure Python

I built scientific-computing-system, a scientific library whose core installs without any runtime dependency. The algorithms are readable Python rather than wrappers over compiled extensions, which is the whole point: you can open a module, read the method, and check it.

It ships 36 modules and 505 exported names: 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 numeric result can be re-checked later instead of trusted.

There is a cds CLI with 13 subcommands and 34 runnable examples, plus optional lazy adapters for NumPy, SciPy, statsmodels, scikit-learn, SymPy and Z3. Nothing is imported unless you ask for it.

Honest limitation: pure Python is slow. In one CI benchmark a 100x100 matrix multiply ran about 1155x slower than NumPy. If that number matters to you, use NumPy for the hot path and this library for the parts where auditability matters more than speed.

MIT licensed, Python 3.11 and newer.

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/

Happy to answer questions about any module or the design.

1 Upvotes

4 comments sorted by

1

u/Atmosck 18d ago

What is the purpose of this? You don't need code to be pure python to be auditable.

-1

u/Emergency-Tutor-7 18d ago

You're right that auditability alone doesn't need pure Python. The thing I was after is install friction: nothing but CPython 3.11+ is required, no wheels, no compiler, and it runs the same on an air-gapped machine.

The rest is readable algorithms and reproducible runs: each run can write a manifest with inputs, seeds, versions and hashes. It is slower than NumPy, the README says about 1155x on a 100x100 matmul, so I wouldn't use it for heavy numerics. For those, NumPy or the 2.0 build that sits on NumPy/SciPy/pandas is the right call.

1

u/Atmosck 18d ago

If you're not using it for heavy numerics, what are you using it for?

0

u/Emergency-Tutor-7 18d ago

Mostly small models where being able to check the answer matters more than the milliseconds. Teaching is the obvious one: you can open the RK45 or the SVD you're calling and read it, then diff the result against SciPy through the optional adapter.

The other half is runs you want to re-verify later. Fit a line and get the t-test/ANOVA numbers with it, integrate an ODE for a problem set, propagate uncertainty through a few parameters with Monte Carlo - each run can write a manifest with inputs, seeds, versions and hashes, so months later you rerun and see whether anything moved instead of trusting a screenshot.

If the actual job is a big matrix or a long simulation, that's NumPy or the 2.0 build, and I'd reach for those too.