Skip to content

Modules overview

cds2 ships forty-six importable modules plus a CLI. Every heavy computation is delegated to NumPy/SciPy; pandas carries tabular data; matplotlib renders figures.

Two thin wrappers, cds2.special and cds2.distributions, are deprecated since 4.3.0; prefer scipy.special and scipy.stats directly.

Core scientific stack

Module Built on Purpose
cds2.linalg numpy.linalg solve, det, inv, pinv, eig/eigh, SVD, least squares, cholesky, norms
cds2.stats scipy.stats t-tests, ANOVA, non-parametrics, correlations, chi-square, effect sizes
cds2.optimize scipy.optimize minimize, root finding, linear programming, curve fitting
cds2.integrate scipy.integrate quad, multi-dimensional integration, ODE solvers, Newton-Cotes rules
cds2.interpolate scipy.interpolate linear/cubic/pchip splines, lagrange, scattered and regular grids
cds2.signals scipy.signal FFT family, PSD/welch/spectrogram, Butterworth filters, peaks, envelope
cds2.montecarlo numpy.random seeded pi estimate, MC integration/expectation, Metropolis-Hastings
cds2.graph scipy.sparse.csgraph components, shortest paths, MST, PageRank, centrality measures
cds2.ml numpy + cKDTree linear/logistic regression, k-means++, PCA, kNN, metrics, generators
cds2.timeseries pandas moving average, EWM, decomposition, ACF/PACF, Ljung-Box
cds2.viz matplotlib series, histogram, scatter, heatmap, spectrum, regression, confusion
cds2.io pandas CSV/JSON read-write, optional Excel/Parquet bridges, DataFrame summaries
cds2.calculus NumPy/SciPy derivative, complex-step gradient, jacobian, hessian, error propagation
cds2.special (deprecated) scipy.special gamma, erf, Bessels, elliptics, orthogonal polynomials, zeta
cds2.sparse scipy.sparse.linalg CG/GMRES/BiCGSTAB, Lanczos eigenpairs, truncated SVD
cds2.spectral scipy.sparse Laplacians, Fiedler vector, algebraic connectivity, spectral clustering
cds2.distributions (deprecated) scipy.stats pdf/cdf/ppf for twenty-plus distributions

Discovery and modelling

Module Built on Purpose
cds2.infotheory NumPy entropy, KL / Jensen-Shannon divergence, mutual information, permutation entropy
cds2.chaos NumPy delay embedding, Lyapunov exponents, correlation dimension, Hurst exponent
cds2.bayes scipy.stats conjugate updates, credible intervals, naive Bayes, Metropolis posteriors
cds2.metaheuristics NumPy genetic algorithm, particle swarm optimization, simulated annealing
cds2.geometry scipy.spatial convex hull, closest pair, polygons, point-in-polygon, intersections
cds2.rl NumPy bandits (epsilon-greedy, UCB1), tabular Q-learning, grid world
cds2.quality NumPy + scipy.stats Shewhart/EWMA/CUSUM/p control charts, Cp/Cpk capability, defective PPM
cds2.design NumPy full & fractional factorial DOE, Latin hypercube sampling, central composite
cds2.modeling pure Python expression trees, symbolic diff/integral, polynomial solving, MathModel
cds2.hypothesis pure Python heuristic hypothesis generation with confidence scores
cds2.knowledge pure Python knowledge graph, notebook, ranked search
cds2.scientific pure Python physical constants, formulas and unit conversion
cds2.quantum NumPy statevector circuit simulator up to 16 qubits
cds2.nlp NumPy scalar autograd, BPE tokenizer, attention, mini-GPT forward pass
cds2.cli argparse cds2 console entry point

Import styles

Flat re-exports live on the package root for the most common helpers:

import cds2

cds2.pagerank
cds2.pi_estimate
cds2.minimize

Each module can also be imported directly:

from cds2.graph import pagerank

Versioning

Static semantic versioning: cds2.__version__ mirrors the git tag. The v1.x zero-dependency line is maintained separately in its own repository.