Skip to content

Commit afe7a00

Browse files
committed
Adding new workflow that triggers on GitHub Release publish, builds all 4 TFMs, runs tests, and pushes to nuget.org
1 parent 655db4f commit afe7a00

4 files changed

Lines changed: 173 additions & 36 deletions

File tree

.github/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
changelog:
2+
categories:
3+
- title: New Features
4+
labels: [enhancement, feature]
5+
- title: Bug Fixes
6+
labels: [bug, fix]
7+
- title: Documentation
8+
labels: [documentation]
9+
- title: Other Changes
10+
labels: ["*"]

.github/workflows/NuGetPublish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish to NuGet.org
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: windows-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- uses: actions/setup-dotnet@v4
16+
with:
17+
dotnet-version: |
18+
8.0.x
19+
9.0.x
20+
10.0.x
21+
22+
- name: Extract version from tag
23+
id: version
24+
shell: bash
25+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
26+
27+
- name: Build
28+
run: dotnet build Numerics/Numerics.csproj -c Release -p:Version=${{ steps.version.outputs.VERSION }}
29+
30+
- name: Test (all frameworks)
31+
run: dotnet test -c Release --no-build
32+
33+
- name: Pack
34+
run: dotnet pack Numerics/Numerics.csproj -c Release --no-build -p:Version=${{ steps.version.outputs.VERSION }}
35+
36+
- name: Push to NuGet.org
37+
run: dotnet nuget push "Numerics/bin/Release/RMC.Numerics.${{ steps.version.outputs.VERSION }}.nupkg" --api-key ${{ secrets.NUGET_ORG_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

JOSS_TODO.md

Lines changed: 124 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ JOSS paper format: https://joss.readthedocs.io/en/latest/paper.html (750-1,750 w
2020
| 6 | API documentation | MET | 25+ Markdown files in `docs/`; XML documentation generated from source |
2121
| 7 | Community guidelines (CONTRIBUTING) | MET | `CONTRIBUTING.md` with bug reports, PRs, DCO, security policy |
2222
| 8 | Code of Conduct | MET | `CODE_OF_CONDUCT.md` (Contributor Covenant v2.1) |
23-
| 9 | Automated tests | MET | 1,001 MSTest methods across 149 test classes in `Test_Numerics/` |
23+
| 9 | Automated tests | MET | 1,006 MSTest methods across 150 test classes in `Test_Numerics/` |
2424
| 10 | Continuous integration | MET | 3 GitHub Actions workflows (`Integration.yml`, `Snapshot.yml`, `Release.yml`) |
25-
| 11 | Substantial scholarly effort | MET | 60,000+ LOC library, 34,000+ LOC tests, 224 source files |
25+
| 11 | Substantial scholarly effort | MET | 60,000+ LOC library, 34,000+ LOC tests, 248 source files |
2626
| 12 | Sustained development history | MET | 2.5 years (Sep 2023 - Mar 2026), 270+ commits, 7+ contributors |
2727
| 13 | Statement of need | MET | Paper includes Statement of Need section |
2828
| 14 | State of the field / related work | MET | Paper includes State of the Field section |
2929
| 15 | Zero or documented dependencies | MET | Zero runtime dependencies for .NET 8+; polyfills only for .NET Framework 4.8.1 |
3030
| 16 | Functionality matches claims | MET | All claims verified: 43 distributions, 8 MCMC samplers, 5+ optimizers, copulas, ML, bootstrap |
31-
| 17 | Software installable | REMAINING | Verify NuGet package `RMC.Numerics` is published and accessible on nuget.org |
31+
| 17 | Software installable | REMAINING | Publish `RMC.Numerics` to nuget.org (see Step 4 below) |
3232

3333
### Paper Requirements
3434

@@ -54,59 +54,100 @@ JOSS paper format: https://joss.readthedocs.io/en/latest/paper.html (750-1,750 w
5454
|---|-------------|--------|----------|
5555
| 31 | CITATION.cff | MET | `CITATION.cff` (CFF v1.2.0, BSD-3-Clause) |
5656
| 32 | codemeta.json | MET | `codemeta.json` created |
57-
| 33 | Version tag matching submission | REMAINING | Need to create `v2.0.0` tag |
57+
| 33 | Version tag matching submission | REMAINING | Need to create `v2.0.0` tag after merge to `main` |
5858
| 34 | Archived release with DOI | REMAINING | Need Zenodo archive |
5959

6060
---
6161

62-
## Section B: Step-by-Step Pre-Submission Actions
62+
## Section B: BES Paper Review Comments (Addressed)
6363

64-
Complete these steps in order before submitting to JOSS.
64+
| # | Comment | Status | Action |
65+
|---|---------|--------|--------|
66+
| 1 | Co-author ORCIDs (Fields, Gonzalez, Niblett, Beam) | PENDING | Follow up with co-authors separately |
67+
| 2 | "Differential Evolution MCMC" → "Adaptive Differential Evolution MCMC" (line 53) | DONE | Clarifies DE-MCz vs DE-MC |
68+
| 3 | "needed for reliable calibration" → "commonly applied for Bayesian inference" (line 61) | DONE | More accurate characterization |
6569

66-
### Step 1: Review and Finalize Paper Edits
67-
- [ ] Review all changes made to `paper/paper.md` (code example, Software Design rewrite, claim softening, ML mention, Gelman-Rubin citation)
68-
- [ ] Review all changes to `paper/paper.bib` (ribatet fix, hoffman URL, Gelman-Rubin 1992 addition)
69-
- [ ] Review `CITATION.cff` changes (ORCID, affiliations, date)
70-
- [ ] Review `README.md` changes (badges, contributing link, doc table reorder)
71-
- [ ] Proofread final paper for any remaining issues
72-
- [ ] Optionally encourage co-authors to register ORCIDs and add them to `paper.md`
70+
---
71+
72+
## Section C: Pre-Release Verification
73+
74+
- [ ] Run full test suite across all target frameworks:
75+
```
76+
dotnet test --framework net8.0
77+
dotnet test --framework net9.0
78+
dotnet test --framework net10.0
79+
dotnet test --framework net481
80+
```
81+
- [ ] Confirm all 1,006+ tests pass on every target
82+
- [ ] Build the NuGet package locally:
83+
```
84+
dotnet pack Numerics/Numerics.csproj -c Release
85+
```
86+
- [ ] Verify the .nupkg contains assemblies for all 4 TFMs
7387

74-
### Step 2: Verify NuGet Package
75-
- [ ] Confirm `RMC.Numerics` is published and accessible at https://www.nuget.org/packages/RMC.Numerics/
76-
- [ ] If not on nuget.org, consider publishing there (JOSS reviewers will try to install it)
77-
- [ ] Verify installation works: `dotnet add package RMC.Numerics`
88+
---
7889

79-
### Step 3: Run Full Test Suite
80-
- [ ] Run `dotnet test` across all target frameworks to confirm no regressions
81-
- [ ] Verify all 1,001+ tests pass
90+
## Section D: Release Roadmap (Step-by-Step)
8291

83-
### Step 4: CI Pipeline Transparency (Recommended)
84-
- [ ] The CI uses shared workflows from `HydrologicEngineeringCenter/dotnet-workflows` which are opaque to reviewers
85-
- [ ] Consider adding a brief comment in the workflow YAML or a CI section in the README explaining what the pipeline does
86-
- [ ] The CI config specifies `dotnet-version: '9.0.x'` — consider testing against all target frameworks (8.0, 9.0, 10.0) or documenting that the shared workflow handles multi-targeting
92+
### Step 1: Create Pull Request to `main`
93+
- [ ] Push latest `bugfixes-and-enhancements` to origin
94+
- [ ] Create PR:
95+
```
96+
gh pr create --base main --head bugfixes-and-enhancements \
97+
--title "v2.0.0: Major update" --body-file RELEASE_NOTES.md
98+
```
99+
- [ ] Wait for CI (Integration.yml) to pass
100+
- [ ] Review and merge PR
87101

88-
### Step 5: Create Release Tag
89-
- [ ] Merge the `bugfixes-and-enhancements` branch to `main`
90-
- [ ] Create git tag: `git tag v2.0.0`
91-
- [ ] Push tag: `git push origin v2.0.0`
92-
- [ ] Create a GitHub Release from the tag with release notes
102+
### Step 2: Tag and GitHub Release
103+
- [ ] After merge:
104+
```
105+
git checkout main && git pull
106+
git tag v2.0.0
107+
git push origin v2.0.0
108+
```
109+
- [ ] Create GitHub Release:
110+
```
111+
gh release create v2.0.0 --title "v2.0.0 — Major Update" --notes-file RELEASE_NOTES.md
112+
```
113+
- [ ] `Release.yml` auto-triggers → pushes to internal USACE Nexus
114+
- [ ] `NuGetPublish.yml` auto-triggers → pushes to nuget.org
115+
116+
### Step 3: One-Time NuGet.org Setup (before first release)
117+
- [ ] Create/verify nuget.org account at https://www.nuget.org/
118+
- [ ] Generate API key at https://www.nuget.org/account/apikeys:
119+
- Name: `GitHub Actions - Numerics`
120+
- Expiration: 365 days
121+
- Glob pattern: `RMC.Numerics`
122+
- Scopes: "Push new packages and package versions"
123+
- [ ] Add secret to GitHub repo at https://github.com/USACE-RMC/Numerics/settings/secrets/actions:
124+
- Name: `NUGET_ORG_API_KEY`
125+
- Value: the API key from above
126+
127+
### Step 4: Verify NuGet Package
128+
- [ ] Check https://www.nuget.org/packages/RMC.Numerics/ (may take 10-15 min to index)
129+
- [ ] Test installation:
130+
```
131+
dotnet new console -o TestInstall && cd TestInstall
132+
dotnet add package RMC.Numerics --version 2.0.0
133+
dotnet build
134+
```
93135

94-
### Step 6: Archive on Zenodo
136+
### Step 5: Zenodo Archival
95137
- [ ] Go to https://zenodo.org and log in with GitHub
96138
- [ ] Enable the `USACE-RMC/Numerics` repository in Zenodo's GitHub integration
97139
- [ ] Zenodo will automatically archive the GitHub Release and mint a DOI
98140
- [ ] Copy the Zenodo DOI badge and add it to `README.md`
99141
- [ ] Update `CITATION.cff` with the Zenodo DOI if desired
100142

101-
### Step 7: Submit to JOSS
143+
### Step 6: Submit to JOSS
102144
- [ ] Go to https://joss.theoj.org/papers/new
103145
- [ ] Enter the repository URL: `https://github.com/USACE-RMC/Numerics`
104146
- [ ] Enter the Zenodo archive DOI
105147
- [ ] Confirm software version matches the tagged release
106148
- [ ] Submit the paper
107-
- [ ] The JOSS editorial bot will open a review issue — respond promptly to any reviewer questions
108149

109-
### Step 8: Post-Submission
150+
### Step 7: Post-Submission
110151
- [ ] Add the JOSS status badge to `README.md` once the review issue is created:
111152
```markdown
112153
[![status](https://joss.theoj.org/papers/<DOI>/status.svg)](https://joss.theoj.org/papers/<DOI>)
@@ -116,9 +157,58 @@ Complete these steps in order before submitting to JOSS.
116157

117158
---
118159

160+
## Section E: v2.0.0 Release Notes
161+
162+
### v2.0.0 — Major Update
163+
164+
This is a major update to Numerics with 274 files changed, 24,476 insertions, and 4,400 deletions since v1.0.0. Highlights include new distributions, improved MCMC inference, enhanced numerical methods, and comprehensive documentation.
165+
166+
#### New Distributions
167+
- Dirichlet distribution (multivariate)
168+
- Multinomial distribution (multivariate)
169+
- Multivariate Student-t distribution
170+
- Student-t copula
171+
172+
#### Bayesian Inference & MCMC
173+
- Improved Gelman-Rubin convergence diagnostics
174+
- Refactored Noncentral-T to use Brent.Solve
175+
- Enhanced MCMC sampler reliability and convergence
176+
177+
#### Numerical Methods
178+
- Linear algebra enhancements
179+
- Root-finding improvements
180+
- ODE solver improvements
181+
- Improved adaptive integration
182+
183+
#### Data & Statistics
184+
- Time series download improvements
185+
- Hypothesis test enhancements
186+
- Enhanced parameter estimation methods
187+
- Autocorrelation and convergence diagnostics improvements
188+
189+
#### Optimization
190+
- Comprehensive correctness improvements across all optimizers
191+
192+
#### Machine Learning
193+
- Documentation consolidation
194+
- Code quality improvements
195+
196+
#### Infrastructure & Documentation
197+
- Added .NET 10.0 target framework (now targets net8.0, net9.0, net10.0, net481)
198+
- Zero runtime dependencies maintained
199+
- 1,006+ unit tests validated against published references
200+
- JOSS paper and metadata (CITATION.cff, codemeta.json)
201+
- CONTRIBUTING.md and CODE_OF_CONDUCT.md
202+
- 25+ documentation files covering all library capabilities
203+
- NuGet publishing workflow for nuget.org
204+
205+
---
206+
119207
## Notes
120208

121-
- **Word limit**: JOSS papers should be 750-1,750 words (https://joss.readthedocs.io/en/latest/paper.html). Current paper is ~1,317 words.
209+
- **Word limit**: JOSS papers should be 750-1,750 words (https://joss.readthedocs.io/en/latest/paper.html). Current paper is ~1,215 words.
122210
- **"Jery R. Stedinger"**: This spelling in `paper.bib` is correct (confirmed on USGS publications). Be prepared to explain if a reviewer questions it.
123211
- **England 2019 vs 2018**: Bulletin 17C was originally published March 2018; the `2019` date refers to the v1.1 revision. Both are acceptable in the literature.
124212
- **ter Braak citation**: The 2008 paper describes DE-MCzs (with snooker updater). The library has both `DEMCz` and `DEMCzs` classes. The citation is appropriate since the 2008 paper supersedes the 2006 original.
213+
- **NuGet API key expiration**: The nuget.org API key expires after 365 days max. Set a calendar reminder to regenerate it.
214+
- **Versioning**: Version is derived from git tags (e.g., `v2.1.0` → package version `2.1.0`). The `.csproj` version is a fallback for local builds only.

paper/paper.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ Numerics fills this gap by providing domain-specific capabilities within .NET:
5050

5151
- **Hydrology-specific distributions**: Log-Pearson Type III, Generalized Extreme Value, Pearson Type III, Generalized Pareto, and Kappa-Four, with L-moment parameter estimation [@hosking1990; @hosking1997] that outperforms conventional moments for the small samples typical of flood records.
5252
- **Mixed-population and competing-risk models**: Mixture distributions [@waylen1982; @alila2002] for sites where floods arise from distinct causal mechanisms such as rainfall, snowmelt, or dam-regulated releases, and competing-risks models [@crowder2001; @bedford2001] for reliability analysis with multiple failure modes.
53-
- **Bayesian inference**: Six MCMC samplers, including Random Walk Metropolis-Hastings, Adaptive RWMH [@haario2001], Differential Evolution MCMC [@terbraak2008], Hamiltonian Monte Carlo [@neal2011], No-U-Turn Sampler (NUTS) [@hoffman2014], and Gibbs, with improved Gelman-Rubin convergence diagnostics [@gelmanrubin1992; @vehtari2021].
53+
- **Bayesian inference**: Six MCMC samplers, including Random Walk Metropolis-Hastings, Adaptive RWMH [@haario2001], Adaptive Differential Evolution MCMC [@terbraak2008], Hamiltonian Monte Carlo [@neal2011], No-U-Turn Sampler (NUTS) [@hoffman2014], and Gibbs, with improved Gelman-Rubin convergence diagnostics [@gelmanrubin1992; @vehtari2021].
5454
- **Uncertainty quantification**: Bootstrap resampling methods [@efron1993] for confidence intervals on design estimates, a requirement in dam and levee safety risk assessments.
5555
- **Global optimization**: Differential Evolution [@storn1997], Shuffled Complex Evolution [@duan1994], Particle Swarm Optimization [@kennedy1995], Multi-Level Single-Linkage (MLSL) [@rinnooy1987], and Nelder-Mead [@nelder1965] for calibrating complex, multi-modal objective functions.
5656
- **Adaptive numerical integration**: Gauss-Kronrod quadrature [@piessens1983] and VEGAS adaptive Monte Carlo integration [@lepage1978] for efficiently evaluating complex risk integrals involving multiple system components and failure modes, a core computation in quantitative risk assessment.
5757
- **Machine learning**: Supervised and unsupervised algorithms, including generalized linear models, decision trees, random forests, k-nearest neighbors, k-means clustering, and Gaussian mixture models for regression, classification, and clustering tasks in risk assessment workflows.
5858

5959
# State of the Field
6060

61-
General-purpose .NET numerical libraries exist, most notably Math.NET Numerics [@mathnetnumerics], which provides linear algebra, probability distributions, and basic statistics. However, Math.NET Numerics does not include L-moment estimation, hydrology-specific distributions (Log-Pearson Type III, Kappa-Four), mixture and competing-risk models, adaptive integration, bootstrap resampling, copulas, or global optimization algorithms. Math.NET Numerics includes basic MCMC samplers (Metropolis-Hastings, Hybrid Monte Carlo, Slice), but lacks the adaptive and ensemble methods (Adaptive RWMH, DE-MCzs, NUTS) needed for reliable calibration of hydrologic models. Contributing these features to Math.NET Numerics was not pursued because the scope of domain-specific functionality, the distinct API design requirements for risk assessment workflows, and the need for long-term maintenance by a domain-expert organization warranted an independent library.
61+
General-purpose .NET numerical libraries exist, most notably Math.NET Numerics [@mathnetnumerics], which provides linear algebra, probability distributions, and basic statistics. However, Math.NET Numerics does not include L-moment estimation, hydrology-specific distributions (Log-Pearson Type III, Kappa-Four), mixture and competing-risk models, adaptive integration, bootstrap resampling, copulas, or global optimization algorithms. Math.NET Numerics includes basic MCMC samplers (Metropolis-Hastings, Hybrid Monte Carlo, Slice), but lacks the adaptive and ensemble methods (Adaptive RWMH, DE-MCzs, NUTS) commonly applied for Bayesian inference of hydrologic models. Contributing these features to Math.NET Numerics was not pursued because the scope of domain-specific functionality, the distinct API design requirements for risk assessment workflows, and the need for long-term maintenance by a domain-expert organization warranted an independent library.
6262

6363
In other language ecosystems, Python's SciPy [@virtanen2020] provides broad numerical capabilities but lacks specialized hydrological distributions and L-moment estimation. R packages such as `lmom` [@hosking2019lmom] and `evd` [@stephenson2002evd] offer these features individually, but integrating R into .NET production applications introduces runtime dependencies and complicates deployment in regulated government environments. No single package in any ecosystem consolidates mixture distributions, competing-risk models, adaptive integration, extreme-value statistics, global optimization, bootstrapping, machine learning, and MCMC into a unified library for engineering risk analysis.
6464

0 commit comments

Comments
 (0)