Skip to content

Releases: USACE-RMC/Numerics-Python-Examples

v1.0.0 — Initial public release

23 Apr 22:25
45c5f5c

Choose a tag to compare

First public release of Numerics-Python-Examples — a curated set of Jupyter notebooks and standalone Python scripts that demonstrate the RMC.Numerics .NET library from Python via pythonnet. Built against RMC.Numerics 2.0.1.

What's in this release

13 notebooks

# Notebook Topic
00 00_getting_started Setup, DLL loading via resolve_numerics_dll(), .NET ↔ Python conversions, wrapping Python callbacks as .NET delegates
01 01_distributions Normal, LogNormal, GEV (Hosking parameterization), Gamma, Weibull, Uniform, Triangular, PERT, Poisson, Binomial, plus Latin Hypercube sampling
02 02_distribution_fitting MOM, MLE, L-Moments fitting with log-likelihood / AIC / BIC / KS goodness-of-fit comparisons
03 03_mcmc_basics RWMH intro, priors, log-likelihood construction, trace diagnostics
04 04_mcmc_bayesian_inference Flood-frequency Bayesian workflow, Bayesian linear regression, posterior predictive checks, RWMH vs DEMCzs
05 05_mcmc_adaptive ARWMH, DEMCz, DEMCzs, HMC, NUTS; side-by-side Numerics-vs-PyMC benchmarks on Logistic / Gumbel / Weibull
06 06_mcmc_diagnostics Multiple chains, Gelman–Rubin R̂, effective sample size, autocorrelation, multimodal mixture fitting
07 07_integration_and_root_finding Adaptive Gauss–Kronrod, Simpson, trapezoidal integration; bisection, Brent, Newton–Raphson, secant
08 08_optimization BFGS / Nelder-Mead / Powell (local); DE / PSO / SA / SCE / MLSL / MultiStart (global); Augmented Lagrange (constrained). With best-objective convergence plots and contour-path overlays on 2D Rosenbrock
09 09_statistics Descriptive statistics, hypothesis tests, bootstrap methods
10 10_time_series Time series objects, block maxima (annual / water year / monthly / quarterly), missing-value interpolation
11 11_machine_learning K-Means, GMM, KNN, Decision Trees, Random Forest — including side-by-side scikit-learn benchmarks
12 12_linear_models Linear and generalized linear models

3 end-to-end example scripts

  • examples/bayesian_regression.py — Bayesian linear regression with Numerics DEMCzs
  • examples/flood_frequency_analysis.py — LogNormal / GEV / Weibull frequency analysis with KS-test model selection
  • examples/reliability_analysis.py — Monte Carlo reliability analysis (resistance vs. load, β and Pf)

Quick start

# Windows (PowerShell)
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r notebook-requirements.txt
dotnet add package RMC.Numerics        # pulls the latest; append --version 2.0.1 to pin
jupyter lab

The notebooks auto-discover Numerics.dll via resolve_numerics_dll() in notebooks/helper_functions.py — no hard-coded paths. Full walkthrough (including macOS / Linux) is in 00_getting_started.ipynb.

Requirements

  • Python 3.10–3.13 (pythonnet does not yet support 3.14)
  • .NET 6+ runtime (or .NET Framework 4.8.1 on Windows)
  • RMC.Numerics 2.0.1 (or newer) from NuGet

Citation

If you use this repository in published work, please cite via this release's DOI (see the Zenodo badge once provisioned) or use the information in CITATION.cff. Companion library: USACE-RMC/Numerics.

License

Released under the USACE-RMC BSD-style license with a no-endorsement clause. Compatible with the parent Numerics project license.

Acknowledgements

Notebooks authored by Sadie Niblett, Julian Gonzalez, and C. Haden Smith (USACE-RMC). See CITATION.cff for ORCIDs.