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 0120e23b44e4da73e24fa1f91506efaca383fa93

BranchesTags
Open more actions menu

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/ISSUE_TEMPLATE
.github/ISSUE_TEMPLATE
 
 
.vscode
.vscode
 
 
bestfit_examples
bestfit_examples
 
 
data
data
 
 
docs
docs
 
 
dotnet
dotnet
 
 
notebooks
notebooks
 
 
results
results
 
 
scripts
scripts
 
 
tests
tests
 
 
validation
validation
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CITATION.cff
CITATION.cff
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
curriculum-cases.json
curriculum-cases.json
 
 
notebook-requirements.txt
notebook-requirements.txt
 
 
pyproject.toml
pyproject.toml
 
 
runtime-lock.json
runtime-lock.json
 
 

Repository files navigation

BestFit Python Examples

Twelve concise walkthroughs follow the projects in RMC-BestFit, with frozen inputs, visible model choices, saved results and an explicit full-settings rerun path. They cover flood frequency, dependence, rating curves and time series. Controlled synthetic cases are identified as such.

Notebook App examples and purpose
00 · Time-series data USGS daily, instantaneous, peak and measured series; other import routes
01 · Input data Calendar/water-year maxima, Big Bear POT, historical information
02 · Distribution fitting Fifteen candidates for four Kamp/Zwettl inputs
03 · Stationary and information expansion Nine Viglione GEV alternatives
04 · Nonstationary univariate Brays Bayou LP-III links and DIC model averaging
05 · Bulletin 17C Official examples 2 (Orestimba) and 4 (Pueblo), MVN and BCB
06 · Advanced univariate Point process, mixtures/zero inflation, competing flood types
07 · Bivariate analysis Six copulas, value/CDF scatter and contours
08 · Coincident frequency Sum of Normals and Waimea stage response
09 · Rating curves Mississippi field measurements and segmented ratings
10 · Classic time series Airline, Nile and Mauna Loa
11 · Regression Simple/multiple consumption regression

Run the saved walkthroughs

Use Python 3.10+ in a virtual environment. Work from a checkout: large fixture/result files are not installed into the examples wheel. Keep a compatible RMC-BestFit checkout beside it, or substitute its path below. runtime-lock.json records the required revision. Before it is published, use the supplied local development checkout.

python -m venv .venv
.venv/Scripts/python.exe -m pip install -e ".[notebooks,test]"
.venv/Scripts/python.exe -m pip install ../RMC-BestFit/skills/bestfit-frequency
.venv/Scripts/python.exe -m pip install jupyterlab
.venv/Scripts/python.exe -m jupyterlab

On Linux/macOS the interpreter is .venv/bin/python. Open a notebook and select that environment's Python kernel. RUN_ANALYSES = False is the default. Saved walkthroughs need no .NET host, live download, API server or new MCMC run. They verify source and cache checksums before using saved coordinates.

Repeat an analysis

Install the .NET 10 SDK and build the locked portable BestFit source with RMC.Numerics 2.2.0. Both assemblies are verified as one runtime; the loader never chooses arbitrary DLLs from a machine cache.

.venv/Scripts/python.exe scripts/bootstrap_runtime.py --bestfit-source ../RMC-BestFit --install-plots

Without --bestfit-source, bootstrap clones the exact locked revision into .runtime/source once it is available upstream. Restart the kernel, set RUN_ANALYSES = True, and execute the desired notebook. Priors, seeds, iterations, thinning, transformations and probability ordinates are retained. Linked analyses rerun in dependency order; coincident frequency receives fresh marginal uncertainty samples. Full runs can take substantially longer. Execution success and sampler convergence are separate checks.

Reruns write receipts and compressed results under output/reruns/. Checked-in results/ caches describe the original saved app projects, making desktop comparisons reproducible. See python scripts/run_curriculum_analyses.py --help for selective batch execution and verified receipt reuse.

Shared app plots

The notebooks use the canonical bestfit_plots package in the BestFit skill. The same package serves API snapshots. The plot gallery and app-to-Python map trace 45 desktop slots to source methods, adapters and independent geometry checks. Read each recorded status before claiming parity.

from bestfit_examples.results import saved_case
case = saved_case("bulletin-17c-examples", "Example #2")
display(case.settings)
case.show("frequency")

The BestFit skill's scripts/plot_source.py lists and renders saved case, PlotSpec and API-source artifacts, writing PNG/SVG/JSON. The target is app geometry and semantics with Matplotlib fonts; custom desktop styles and exact pixels are outside the comparison.

Sources and validation

data/source-manifest.json records hashes and original paths for 22 full-fidelity project exports (about 145 MiB). The additional Sinnemahoning fixture supplies uncertain observations for notebook 01 and the plot gallery. Historical bounds, uncertain observations, compressed payloads, configurations and saved ensembles are preserved. Notebook 05 cites official Bulletin 17C Appendix 10; notebook 10 documents the Nile date discrepancy and explicit display correction while preserving original bytes.

.venv/Scripts/python.exe -m pytest
.venv/Scripts/python.exe scripts/validate_notebooks.py --write

Validation uses a separate kernel for every notebook. validation/ records execution, full-settings runs, retained superseded attempts and source checks. These are engineering evidence and numerical diagnostics, not scientific acceptance of every fitted model. Rebuild caches after reviewed adapter changes with python scripts/build_saved_results.py.

The earlier seven notebooks and loose scripts are superseded. Their history remains in Git; migration.md maps former entry points. Read the source review for the scientific context and corrections; the five-package plan is retained under docs/superpowers.

Released under the Zero-Clause BSD license.

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.