Skip to main content

scientific-computing-system-2.0

CI PyPI Python License: MIT Code style: ruff

CDS v2 is a scientific computing platform built on the scientific Python stack — NumPy, SciPy, pandas and matplotlib. The algorithms proven in the pure-Python cognitive-discovery-system (v1.x) form its foundation; v2 rebuilds them for speed and adds new domain modules on top.

Installation

pip install scientific-computing-system-2.0

From source:

git clone https://github.com/Furox-Art/scientific-computing-system-2.0.git
cd scientific-computing-system-2.0
pip install -e .[dev]

Quick start

import numpy as np
import cds2

# Linear algebra
A = [[3.0, 1.0], [1.0, 2.0]]
b = [9.0, 8.0]
x = cds2.linalg.solve(A, b)

# Statistics
r = cds2.stats.independent_t_test([1, 2, 3, 4, 5], [3, 4, 5, 6, 7])

# Optimization
res = cds2.optimize.minimize(lambda v: (v[0] - 2) ** 2 + (v[1] + 1) ** 2, x0=[0.0, 0.0])
print(res.x)  # ~ [2.0, -1.0]

# Signals
freqs, psd = cds2.signals.power_spectrum(np.sin(np.linspace(0, 100, 1024)), fs=256.0)

# Graphs with PageRank
adj = cds2.graph.from_edges(4, [(0, 1), (0, 2), (1, 3), (2, 3)], directed=True)
scores = cds2.graph.pagerank(adj)

# Information theory
h = cds2.infotheory.entropy([0.25, 0.25, 0.25, 0.25])
mi = cds2.infotheory.mutual_information([[0.5, 0.0], [0.0, 0.5]])

# Chaos / nonlinear dynamics
series = cds2.chaos.logistic_map(3.99, length=400, seed=1)
lyap = cds2.chaos.largest_lyapunov_exponent(series)

# Bayesian conjugate updates
post = cds2.bayes.beta_binomial_update(successes=7, failures=3)
print(post.mean)  # 0.7

# Metaheuristics
res = cds2.metaheuristics.pso_minimize(lambda v: (v[0] - 3) ** 2, [(-10, 10)], seed=1)

# Geometry
area = cds2.geometry.hull_area([(0, 0), (1, 0), (0, 1)])

# Reinforcement learning
q_values, returns = cds2.rl.q_learn(cds2.rl.GridWorld(4, 4), episodes=300, seed=1)

Modules

Module Built on Highlights
cds2.linalg NumPy solve, det, inv, pinv, eig/eigh, SVD, least squares, cholesky, cond
cds2.stats scipy.stats t-tests, ANOVA, non-parametrics, correlations, chi-square, effect sizes, normal dist helpers
cds2.optimize scipy.optimize minimize, roots (brentq/newton/system), linprog, least squares, curve fit
cds2.integrate scipy.integrate quad, 2-D/3-D integration, ODE solvers, trapezoid/simpson
cds2.interpolate scipy.interpolate linear/cubic/pchip, lagrange, griddata, regular grids
cds2.signals scipy.signal FFT, PSD/welch/spectrogram, Butterworth filters, peaks, envelope
cds2.montecarlo NumPy Generator pi estimate, MC integration/expectation, hit-or-miss (all seedable)
cds2.graph scipy.sparse.csgraph components, Dijkstra/Bellman-Ford/Floyd-Warshall, MST, topological order, PageRank
cds2.ml NumPy/SciPy LinearRegression, LogisticRegression, KMeans++, PCA, KNN, metrics, data generators
cds2.timeseries pandas moving average, EWM, differencing, seasonal decomposition, ACF/PACF, Ljung-Box
cds2.viz matplotlib series/histogram/scatter/heatmap/spectrum/regression/confusion plots
cds2.io pandas CSV/JSON read-write, optional Excel/Parquet bridges, DataFrame summaries
cds2.calculus NumPy derivative, complex-step gradient, jacobian, hessian
cds2.special scipy.special gamma, erf family, beta, Bessels, zeta
cds2.sparse scipy.sparse.linalg CG/GMRES/BiCGSTAB solvers, Lanczos eigenpairs, truncated SVD
cds2.distributions scipy.stats t, chi2, F, exponential, uniform, lognormal, poisson, binomial (pdf/cdf/ppf)
cds2.spectral scipy.sparse Laplacians, Fiedler vector, algebraic connectivity, spectral clustering
cds2.infotheory NumPy Shannon/joint/conditional entropy, KL & Jensen-Shannon divergence, mutual information, permutation entropy
cds2.chaos NumPy delay embedding, false nearest neighbours, Lyapunov exponent, correlation dimension, sample entropy, Hurst exponent, bifurcation scans
cds2.bayes scipy.stats Beta-Binomial / Normal-Normal / Gamma-Poisson conjugate updates, credible intervals, naive Bayes, Metropolis posteriors
cds2.metaheuristics NumPy real-coded genetic algorithm, particle swarm optimization, simulated annealing
cds2.geometry scipy.spatial convex hull, closest pair, point-in-polygon, polygon area/perimeter, line-segment intersection, rotations
cds2.rl NumPy Bernoulli bandits (epsilon-greedy, UCB1), tabular Q-learning, grid-world environment

CLI

cds2 info
cds2 stats 1,2,3,4,5
cds2 integrate sin --a 0 --b 3.14159
cds2 linsolve --a "3,1;1,2" --b "9,8"
cds2 plot 1,3,2,5,4 --file out.png

Relationship to CDS v1.x

The original zero-dependency pure-Python line lives at Furox88/cognitive-discovery-system and remains available. v2 is an independent project that trades that constraint for the speed and breadth of the scientific Python ecosystem.

Runnable case studies live in examples/ - see the docs page for details.

Benchmarks

cds2 races the scientific stack head-to-head — and ships its own compiled C kernels where they help. Current scoreboard (full methodology in docs/benchmarks.md):

Race Baseline cds2/baseline
PageRank 400n (C kernel) NetworkX 0.18x
K-Means 4k×2 k=8 (C kernel) scikit-learn 0.72x
Linear regression 20k×10 scikit-learn 0.74x
Monte Carlo pi 2M hand-vectorized NumPy 0.77x
solve / eigh / rfft / welch / minimize NumPy & SciPy ~1.00x
describe 500k (adds quartiles) SciPy 1.10x

Wrapper APIs hold parity with raw NumPy/SciPy; the KMeans Lloyd loop and PageRank power iteration are from-scratch C extensions (cds2._fast_kmeans, cds2._fast_pagerank) that beat the specialist libraries. A pure-Python fallback wheel keeps compiler-less installs working.

python benchmarks/run_benchmarks.py            # full run
python benchmarks/run_benchmarks.py --quick    # smoke run

Development

pip install -e .[dev]
pytest            # run the test suite
ruff check .      # lint

License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scientific_computing_system_2_0-4.0.0.tar.gz (132.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

scientific_computing_system_2_0-4.0.0-py3-none-any.whl (91.9 kB view details)

Uploaded Python 3

scientific_computing_system_2_0-4.0.0-cp312-cp312-win_amd64.whl (105.6 kB view details)

Uploaded CPython 3.12Windows x86-64

File details

Details for the file scientific_computing_system_2_0-4.0.0.tar.gz.

File metadata

File hashes

Hashes for scientific_computing_system_2_0-4.0.0.tar.gz
Algorithm Hash digest
SHA256 6ba70c6bb4e718fea369cffbfff0c9b0c34c8e6ed87d8ca68362f23a0a93bfbe
MD5 7e7449dfe3854c6a669111f0b4aa9d27
BLAKE2b-256 3e6c6a1765dd8ea4fd1353f2a9b7cd11937dab6ebfebdbab750adb1805f699de

See more details on using hashes here.

File details

Details for the file scientific_computing_system_2_0-4.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for scientific_computing_system_2_0-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9430232aa6c1ef799d50957733338c376a67f07efa34b7b7c7fc1ef277feb8fd
MD5 8bbff186a187ba24397cb3af5373cd1b
BLAKE2b-256 029b6183543a9a83e0e4f466bf927fdc8da447a45739664615d89a4dd26d53d3

See more details on using hashes here.

File details

Details for the file scientific_computing_system_2_0-4.0.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for scientific_computing_system_2_0-4.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9059af2709afc5a732747b845e83eb4f38e5837d192b9a6e8a3cfb7b9752befc
MD5 1928ef5da98a17bebf758b8a7ffc9d41
BLAKE2b-256 707a6dcb5b1b3dd1771f3f8a61f5429812bfd2b53cf71ba75abcbd85aa06e25f

See more details on using hashes here.

Release history Release notifications | RSS feed

4.2.0

22 files

This release

4.0.0 This release

3 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page