Skip to content

Commit 344473a

Browse files
authored
Merge pull request #133 from USACE-RMC/bugfixes-and-enhancements
v2.0.0: Bugfixes, enhancements, and JOSS paper
2 parents 697e65b + f74af15 commit 344473a

276 files changed

Lines changed: 24900 additions & 4460 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.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/Integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ jobs:
88
CI:
99
uses: HydrologicEngineeringCenter/dotnet-workflows/.github/workflows/integration.yml@main
1010
with:
11-
dotnet-version: '9.0.x'
11+
dotnet-version: '10.0.x'
1212
run-tests: true

.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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,4 @@ MigrationBackup/
370370

371371
#Numerics Specific
372372
/TestResults
373+
/.claude/settings.local.json

CITATION.cff

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
type: software
4+
title: "Numerics"
5+
version: "2.0.0"
6+
date-released: "2026-03-08"
7+
license: BSD-3-Clause
8+
repository-code: "https://github.com/USACE-RMC/Numerics"
9+
url: "https://github.com/USACE-RMC/Numerics"
10+
abstract: >-
11+
Numerics is a free and open-source .NET library providing numerical methods,
12+
probability distributions, statistical analysis, and Bayesian inference tools
13+
for quantitative risk assessment in water resources engineering.
14+
keywords:
15+
- statistics
16+
- probability distributions
17+
- MCMC
18+
- hydrology
19+
- flood frequency analysis
20+
- copulas
21+
- L-moments
22+
- optimization
23+
- .NET
24+
- C#
25+
authors:
26+
- family-names: "Smith"
27+
given-names: "C. Haden"
28+
email: "cole.h.smith@usace.army.mil"
29+
affiliation: "U.S. Army Corps of Engineers, Risk Management Center"
30+
orcid: "https://orcid.org/0000-0002-4651-9890"
31+
- family-names: "Fields"
32+
given-names: "Woodrow L."
33+
affiliation: "U.S. Army Corps of Engineers, Risk Management Center"
34+
- family-names: "Gonzalez"
35+
given-names: "Julian"
36+
affiliation: "U.S. Army Corps of Engineers, Risk Management Center"
37+
- family-names: "Niblett"
38+
given-names: "Sadie"
39+
affiliation: "U.S. Army Corps of Engineers, Risk Management Center"
40+
- family-names: "Beam"
41+
given-names: "Brennan"
42+
affiliation: "U.S. Army Corps of Engineers, Hydrologic Engineering Center"
43+
- family-names: "Skahill"
44+
given-names: "Brian"
45+
affiliation: "Fariborz Maseeh Department of Mathematics and Statistics, Portland State University"

CODE_OF_CONDUCT.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Code of Conduct
2+
3+
This project follows the [Contributor Covenant Code of Conduct v2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
4+
5+
Please read the full text at the link above. In summary, we are committed to providing a welcoming and inclusive environment for everyone. Be respectful, constructive, and professional in all interactions.
6+
7+
## Reporting
8+
9+
If you experience or witness unacceptable behavior, please contact the project maintainers at cole.h.smith@usace.army.mil.
10+
11+
## Attribution
12+
13+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.

CONTRIBUTING.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Contributing to Numerics
2+
3+
Thank you for your interest in contributing to Numerics! We welcome bug reports, feature requests, validation results, and other feedback from the community.
4+
5+
## Review Capacity
6+
7+
Numerics is maintained by a small team within the U.S. Army Corps of Engineers Risk Management Center (USACE-RMC). **Our capacity to review external pull requests is very limited.** We prioritize issues and bug reports, which are always welcome and will be reviewed as resources permit.
8+
9+
If you plan to submit a pull request, please open an issue first to discuss your proposed change. This helps avoid duplicated effort and ensures your contribution aligns with the project's direction.
10+
11+
## How to Contribute
12+
13+
### Report a Bug
14+
15+
If you find a bug, please [open an issue](../../issues/new) and include:
16+
17+
- Steps to reproduce the problem
18+
- Input data and configuration (if applicable)
19+
- Expected behavior vs. actual behavior
20+
- Software version and operating system
21+
- Any relevant error messages or screenshots
22+
23+
### Request a Feature
24+
25+
Feature requests are welcome. Please [open an issue](../../issues/new) describing:
26+
27+
- The use case or problem you are trying to solve
28+
- How you envision the feature working
29+
- Any references to statistical methods or published literature
30+
31+
### Report Validation Results
32+
33+
Given the life-safety applications of this software, independent validation is especially valuable. If you have compared Numerics results against other software (e.g., R packages, published tables, or analytical solutions), we would appreciate hearing about it through an issue.
34+
35+
### Submit a Pull Request
36+
37+
Pull requests may take several weeks or longer to review. Before submitting code:
38+
39+
1. **Open an issue first** to discuss the proposed change
40+
2. **Follow the coding standards**, including XML documentation on all public types and members
41+
3. **Include unit tests** that validate against known results (R, SciPy, Mathematica, or published tables)
42+
4. **Use MSTest** (`[TestClass]`, `[TestMethod]`) as the testing framework
43+
5. **Ensure a clean build** with zero errors and zero warnings
44+
45+
## Developer Certificate of Origin
46+
47+
By submitting a pull request, you certify under the [Developer Certificate of Origin (DCO) Version 1.1](https://developercertificate.org/) that you have the right to submit the work under the license associated with this project and that you agree to the DCO.
48+
49+
All contributions will be released under the same license as the project (see [LICENSE](LICENSE)).
50+
51+
## Federal Government Contributors
52+
53+
U.S. Federal law prevents the government from accepting gratuitous services unless certain conditions are met. By submitting a pull request, you acknowledge that your services are offered without expectation of payment and that you expressly waive any future pay claims against the U.S. Federal government related to your contribution.
54+
55+
If you are a U.S. Federal government employee and use a `*.mil` or `*.gov` email address, your contribution is understood to have been created in whole or in part as part of your official duties and is not subject to domestic copyright protection under 17 USC 105.
56+
57+
## Security
58+
59+
If you discover a security vulnerability, please do **not** open a public issue. Instead, contact the RMC team directly through official USACE-RMC channels.
60+
61+
## License
62+
63+
See [LICENSE](LICENSE) for details. This software is provided by USACE-RMC under a BSD-style license with a no-endorsement clause.

Numerics.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 17
4-
VisualStudioVersion = 17.9.34723.18
3+
# Visual Studio Version 18
4+
VisualStudioVersion = 18.2.11430.68 d18.0
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Numerics", "Numerics\Numerics.csproj", "{9C8B75DE-ABF2-42D3-96C7-18405AD16488}"
77
EndProject

Numerics/Data/Interpolation/Bilinear.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public bool UseSmartSearch
119119
{
120120
_useSmartSearch = value;
121121
X1LI.UseSmartSearch = value;
122-
X1LI.UseSmartSearch = value;
122+
X2LI.UseSmartSearch = value;
123123
}
124124
}
125125

Numerics/Data/Interpolation/CubicSpline.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31+
using System;
32+
using System.Collections.Generic;
33+
3134
namespace Numerics.Data
3235
{
3336
/// <summary>
@@ -62,7 +65,7 @@ public class CubicSpline : Interpolater
6265
{
6366

6467
/// <summary>
65-
/// Construct new linear interpolation.
68+
/// Construct new cubic spline interpolation.
6669
/// </summary>
6770
/// <param name="xValues">List of x-values.</param>
6871
/// <param name="yValues">List of y-values.</param>
@@ -75,7 +78,7 @@ public CubicSpline(IList<double> xValues, IList<double> yValues, SortOrder sortO
7578
/// <summary>
7679
/// Stores the array of second derivatives.
7780
/// </summary>
78-
private double[] y2 = Array.Empty<double>();
81+
private double[] y2 = null!;
7982

8083
/// <summary>
8184
/// Auxiliary routine to set the second derivatives. If you make changes to the x- or y-values, then you need to call this routine afterwards.

0 commit comments

Comments
 (0)