GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - USACE-RMC/BestFit-Python-Examples at 2e9aca714e3a9063f434283407f16e2b0a863a96

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
examples
examples
 
 
notebooks
notebooks
 
 
outputs
outputs
 
 
CITATION.cff
CITATION.cff
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
bestfit-python-demos-scope.md
bestfit-python-demos-scope.md
 
 
notebook-requirements.txt
notebook-requirements.txt
 
 

Repository files navigation

BestFit Python Examples

Practical Python demos for RMC-BestFit using pythonnet, with notebook-first workflows and script examples for flood frequency, rating curves, forecasting, and regional analysis.

What This Repo Contains

  • notebooks/00_getting_started.ipynb to 08_batch_workflow_and_reporting.ipynb
  • examples/ runnable Python scripts
  • notebooks/helper_functions.py shared DLL path helpers
  • bestfit-python-demos-scope.md project scope and roadmap

Requirements

  • Windows + Python 3.10+
  • .NET runtime compatible with your BestFit build
  • RMC DLLs:
    • RMC.BestFit.dll
    • Numerics.dll

Python packages (see notebook-requirements.txt):

  • pythonnet
  • numpy
  • pandas
  • matplotlib
  • scipy
  • statsmodels
  • jupyter

Setup

  1. Install dependencies:
pip install -r notebook-requirements.txt
  1. Set DLL environment variables only if you want to override the local defaults:
$env:RMC_BESTFIT_DLL="C:\GIT\RMC-BestFit\src\RMC.BestFit\bin\Debug\net10.0\RMC.BestFit.dll"
$env:RMC_NUMERICS_DLL="C:\GIT\RMC-BestFit\src\RMC.BestFit\bin\Debug\net10.0\Numerics.dll"
  1. Start Jupyter:
jupyter lab

Open notebooks in numeric order starting with 00_getting_started.ipynb.

Notebooks Guide

  • 00_getting_started.ipynb: runtime setup, DLL loading, first distribution calls, troubleshooting
  • 01_distributions.ipynb: distribution tour and shape comparison
  • 02_distribution_fitting.ipynb: empirical return periods and fitted quantile curves
  • 03_bayesian_flood_frequency.ipynb: uncertainty workflow (bootstrap posterior proxy)
  • 04_model_selection_and_comparison.ipynb: AIC/BIC comparison patterns
  • 05_rating_curve_analysis.ipynb: segmented stage-discharge fitting
  • 06_time_serie_forecasting.ipynb: ARIMAX-style forecasting demo
  • 07_spatial_extremes.ipynb: index-flood regional pooling
  • 08_batch_workflow_and_reporting.ipynb: config-driven multi-site batch flow and exports

Each notebook includes:

  • Intro context
  • Step-by-step code
  • End summary with recommended exercises

Example Scripts

Run from repo root:

py examples\flood_frequency_simple.py
py examples\rating_curve_example.py
py examples\regional_analysis.py

Current script outputs:

  • outputs/tables/flood_frequency_empirical_vs_model.csv
  • outputs/tables/flood_frequency_return_period_table.csv
  • outputs/tables/rating_curve_observed_vs_fit.csv
  • outputs/tables/rating_curve_table.csv
  • outputs/tables/regional_analysis_site_records.csv
  • outputs/tables/regional_analysis_site_quantiles.csv

DLL Resolution Behavior

notebooks/helper_functions.py uses this order:

  1. RMC_BESTFIT_DLL / RMC_NUMERICS_DLL env vars
  2. Known local default paths in this dev environment

If DLL load fails, verify paths first.

Troubleshooting

  • pythonnet runtime error at import:
    • use pythonnet.load("coreclr") for the current .NET build
    • use pythonnet.load("netfx") only for legacy .NET Framework builds
  • FileNotFoundError for DLLs:
    • set env vars explicitly
  • AddReference load conflicts:
    • restart kernel/session and re-run top cells only once

Notes

  • Some notebooks use synthetic data for deterministic demos.
  • Scope and planned enhancements are tracked in bestfit-python-demos-scope.md.
  • Numerics-Python-Examples in sibling folder was used as style/structure reference.

About

A PythonNet demo repository that showcases the RMC.BestFit library for Python users.

github.com/USACE-RMC/RMC-BestFit

Topics

bayesian-statisticscompeting-riskcopulasfitting-curveflood-frequency-analysismixture-distributionsmodel-averagingrating-curvespatial-statisticstime-series-analysis

Resources

Readme
License

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.