You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,9 +37,9 @@ Given the life-safety applications of Numerics, which this demo is an extension
37
37
Pull requests may take several weeks or longer to review. Before submitting code:
38
38
39
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
-
5.**Ensure a clean build**with zero errors and zero warnings
40
+
2.**Follow PEP 8** and add docstrings to new functions and modules; clear notebook outputs before submitting (`jupyter nbconvert --clear-output --inplace notebooks/*.ipynb`)
41
+
3.**Include validation** against known results (R, SciPy, Mathematica, or published tables) where applicable
42
+
4.**Ensure notebooks run end to end**without errors in a fresh virtual environment
This repository contains Python notebooks that demonstrate the Numerics .NET library through pythonnet. The notebooks provide practical, reproducible examples of Numerics applications, including distribution fitting, MCMC, optimization, statistical analysis, time series analysis, machine learning, and linear model fitting.
4
4
@@ -22,60 +22,86 @@ This repository contains Python notebooks that demonstrate the Numerics .NET lib
22
22
-`12_linear_models.ipynb` Linear/GLM workflows
23
23
24
24
## Prerequisites
25
-
-Windows with .NET installed (or .NET 6+ runtime on Linux/macOS)
26
-
-Python with [pythonnet](https://github.com/pythonnet/pythonnet)
27
-
-Numerics built and compiled locally. The resulting DLL path must match the path referenced in the notebooks — see Quick Start and/or notebook 00 for setup instructions.
25
+
-Python **3.10–3.13** recommended. pythonnet does not yet support Python 3.14.
26
+
-.NET 6+ runtime (or .NET Framework 4.8.1 on Windows). Install the [.NET SDK](https://dotnet.microsoft.com/download) if you don't already have it.
27
+
-The [RMC.Numerics](https://www.nuget.org/packages/RMC.Numerics) NuGet package (see Quick Start).
28
28
29
29
## Quick Start
30
-
The quick start will step through the creation of an active python environment, installing the notebook requirements & RMC-Numerics, and getting the methods ready to be used. For a more indepth walk through see notebook 00.
31
-
**NOTE:**This set up is geared towards Windows users. For other operating systems see notebook 00.
30
+
The quick start will walk you through creating a virtual Python environment, installing the notebook requirements, and pulling in the `RMC.Numerics` NuGet package. For a more in-depth walkthrough see notebook [`00_getting_started.ipynb`](notebooks/00_getting_started.ipynb).
31
+
**NOTE:**The commands below assume Windows. See notebook `00` for macOS/Linux equivalents.
32
32
33
33
1. Create and activate a virtual Python environment
Both commands pull the **latest** published version by default. This demo was built against version `2.0.1`; to pin that version, append `--version 2.0.1` (Option A) or `-Version 2.0.1` (Option B).
59
+
60
+
The notebooks auto-discover the DLL in either location via `resolve_numerics_dll()` in [`notebooks/helper_functions.py`](notebooks/helper_functions.py).
61
+
62
+
4. Load Numerics in a notebook or script
63
+
64
+
```python
65
+
import pythonnet
66
+
pythonnet.load("coreclr")
67
+
68
+
import clr
69
+
from helper_functions import resolve_numerics_dll
70
+
clr.AddReference(str(resolve_numerics_dll()))
71
+
```
72
+
73
+
5. Create a Normal distribution
74
+
75
+
```python
76
+
from Numerics.Distributions import Normal
77
+
dist = Normal(100, 15)
78
+
```
79
+
80
+
## Using a local Numerics build instead of NuGet
81
+
82
+
If you prefer to build Numerics from source — for example, to develop against the latest `main` branch — clone the [Numerics](https://github.com/USACE-RMC/Numerics) repo and build it:
`resolve_numerics_dll()` uses this variable first, then falls back to the NuGet cache and finally a local `packages/` folder.
72
101
73
102
## Notes
74
103
- These notebooks compare Numerics to common Python libraries where relevant. When comparing MCMC chains, align warmup/thinning settings.
75
104
- Many examples use synthetic data to keep results consistent and easy to interpret.
76
105
77
-
## How To Update DLL Path
78
-
If your Numerics build output is in a different location, update the DLL path in the setup cell of each notebook. Search for `Numerics.dll` and replace the path with your local build output.
79
-
80
106
## License
81
-
See the Numerics project license for usage and distribution terms.
107
+
This project is released under the [USACE-RMC license](LICENSE). It is compatible with the parent [Numerics project license](https://github.com/USACE-RMC/Numerics/blob/main/LICENSE).
0 commit comments