pynumerics 2.3.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pynumerics/__init__.py +73 -0
- pynumerics/_bin/Microsoft.CodeAnalysis.CSharp.dll +0 -0
- pynumerics/_bin/Microsoft.CodeAnalysis.LICENSE.txt +27 -0
- pynumerics/_bin/Microsoft.CodeAnalysis.dll +0 -0
- pynumerics/_bin/Numerics.dll +0 -0
- pynumerics/_bin/pynumerics.runtimeconfig.json +15 -0
- pynumerics/_coverage.py +3825 -0
- pynumerics/_util.py +237 -0
- pynumerics/_version.py +40 -0
- pynumerics/bootstrap.py +593 -0
- pynumerics/callbacks.py +791 -0
- pynumerics/copulas.py +910 -0
- pynumerics/data.py +2233 -0
- pynumerics/differentiation.py +348 -0
- pynumerics/distributions.py +4043 -0
- pynumerics/download.py +623 -0
- pynumerics/enums.py +119 -0
- pynumerics/errors.py +245 -0
- pynumerics/functions.py +1142 -0
- pynumerics/goodness_of_fit.py +699 -0
- pynumerics/graphs.py +556 -0
- pynumerics/hypothesis_tests.py +445 -0
- pynumerics/identity.py +144 -0
- pynumerics/integration.py +677 -0
- pynumerics/linalg.py +1408 -0
- pynumerics/machine_learning.py +1335 -0
- pynumerics/marshal.py +733 -0
- pynumerics/mathematics.py +1053 -0
- pynumerics/mcmc.py +1406 -0
- pynumerics/multivariate.py +1539 -0
- pynumerics/ode.py +156 -0
- pynumerics/optimization.py +1736 -0
- pynumerics/probability.py +966 -0
- pynumerics/py.typed +0 -0
- pynumerics/regional.py +522 -0
- pynumerics/roots.py +274 -0
- pynumerics/runtime.py +384 -0
- pynumerics/sampling.py +1758 -0
- pynumerics/special.py +1079 -0
- pynumerics/statistics.py +1958 -0
- pynumerics/timeseries.py +1326 -0
- pynumerics-2.3.0.dist-info/METADATA +142 -0
- pynumerics-2.3.0.dist-info/RECORD +46 -0
- pynumerics-2.3.0.dist-info/WHEEL +5 -0
- pynumerics-2.3.0.dist-info/licenses/LICENSE +10 -0
- pynumerics-2.3.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pynumerics
|
|
3
|
+
Version: 2.3.0
|
|
4
|
+
Summary: RMC.Numerics for Python: probability distributions, statistics, MCMC, optimization and numerical methods from the USACE-RMC Numerics library.
|
|
5
|
+
Author-email: Haden Smith <cole.h.smith@usace.army.mil>
|
|
6
|
+
License-Expression: 0BSD
|
|
7
|
+
Project-URL: Homepage, https://github.com/USACE-RMC/Numerics
|
|
8
|
+
Project-URL: Documentation, https://github.com/USACE-RMC/Numerics/tree/main/python/pynumerics/docs
|
|
9
|
+
Project-URL: Repository, https://github.com/USACE-RMC/Numerics
|
|
10
|
+
Project-URL: Issues, https://github.com/USACE-RMC/Numerics/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/USACE-RMC/Numerics/blob/main/python/pynumerics/CHANGELOG.md
|
|
12
|
+
Keywords: statistics,probability distributions,hydrology,flood frequency analysis,L-moments,MCMC,optimization,Monte Carlo,uncertainty analysis,pythonnet
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering :: Hydrology
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
26
|
+
Classifier: Typing :: Typed
|
|
27
|
+
Requires-Python: <3.15,>=3.11
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: pythonnet<3.2,>=3.1
|
|
31
|
+
Requires-Dist: numpy>=1.26
|
|
32
|
+
Provides-Extra: test
|
|
33
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
34
|
+
Requires-Dist: numpydoc>=1.8; extra == "test"
|
|
35
|
+
Requires-Dist: ruff>=0.6; extra == "test"
|
|
36
|
+
Requires-Dist: scipy>=1.11; extra == "test"
|
|
37
|
+
Requires-Dist: statsmodels>=0.14; extra == "test"
|
|
38
|
+
Requires-Dist: scikit-learn>=1.3; extra == "test"
|
|
39
|
+
Requires-Dist: shapely>=2.0; extra == "test"
|
|
40
|
+
Requires-Dist: arviz<1,>=0.17; extra == "test"
|
|
41
|
+
Requires-Dist: dataretrieval>=1.4; extra == "test"
|
|
42
|
+
Requires-Dist: wetterdienst>=0.184; extra == "test"
|
|
43
|
+
Requires-Dist: kiwis-pie>=0.10.5; extra == "test"
|
|
44
|
+
Provides-Extra: docs
|
|
45
|
+
Requires-Dist: sphinx<10,>=8; extra == "docs"
|
|
46
|
+
Requires-Dist: numpydoc>=1.8; extra == "docs"
|
|
47
|
+
Requires-Dist: myst-parser>=4; extra == "docs"
|
|
48
|
+
Dynamic: license-file
|
|
49
|
+
|
|
50
|
+
# pynumerics
|
|
51
|
+
|
|
52
|
+
RMC.Numerics for Python. The wheel ships the `Numerics.dll` assembly from the published
|
|
53
|
+
`RMC.Numerics` NuGet package, byte for byte, with a loader that starts one .NET runtime and one
|
|
54
|
+
`Numerics` assembly per process, and typed wrappers over every Numerics area: univariate and
|
|
55
|
+
multivariate distributions, copulas, statistics, hypothesis tests, sampling, MCMC and the
|
|
56
|
+
bootstrap, integration, differentiation, root finding and ODEs, optimization, special functions,
|
|
57
|
+
linear algebra and Fourier transforms, data and time series, and machine learning.
|
|
58
|
+
|
|
59
|
+
The wrappers do no numerical work in Python. Arrays cross between NumPy and .NET in bulk, bit for
|
|
60
|
+
bit, every wrapper raises Python exceptions with the Numerics messages, and functions can be
|
|
61
|
+
Python callables or C# source compiled with the bundled Roslyn compiler. The distribution version
|
|
62
|
+
equals the RMC.Numerics version of the bundled assembly.
|
|
63
|
+
|
|
64
|
+
## Install
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pip install pynumerics==2.3.0
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The 2.3.0 wheel bundles `Numerics.dll` from the RMC.Numerics 2.3.0 NuGet package. Requirements:
|
|
71
|
+
CPython 3.11 to 3.14 on Linux or Windows, and the .NET 10 runtime (`Microsoft.NETCore.App` 10.0).
|
|
72
|
+
Set `DOTNET_ROOT` when .NET is not installed in the default location.
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from pynumerics import distributions
|
|
76
|
+
|
|
77
|
+
gev = distributions.GeneralizedExtremeValue(location=10.0, scale=2.0, shape=-0.1)
|
|
78
|
+
print(gev.inverse_cdf([0.5, 0.99, 0.999])) # one call into InverseCDF(IList<double>)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Documentation
|
|
82
|
+
|
|
83
|
+
The user guide and the API reference are in
|
|
84
|
+
[`docs/`](https://github.com/USACE-RMC/Numerics/tree/main/python/pynumerics/docs): start with
|
|
85
|
+
[getting started](https://github.com/USACE-RMC/Numerics/blob/main/python/pynumerics/docs/getting-started.md),
|
|
86
|
+
which covers installation, `PYNUMERICS_DLL_DIR` and runtime selection, arrays and errors, value
|
|
87
|
+
semantics, callbacks and migration from rmc-numerics. The
|
|
88
|
+
[changelog](https://github.com/USACE-RMC/Numerics/blob/main/python/pynumerics/CHANGELOG.md) lists
|
|
89
|
+
the changes of each release. Build the HTML pages, including the API
|
|
90
|
+
reference generated from the docstrings, from `python/pynumerics`:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
python -m pip install -e ".[docs]"
|
|
94
|
+
python -m sphinx -W --keep-going -b html docs docs/_build/html
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Releases are published to PyPI by `.github/workflows/PythonPublish.yml` with trusted publishing.
|
|
98
|
+
It starts by itself when `NuGetPublish.yml` has pushed RMC.Numerics X.Y.Z to nuget.org for the
|
|
99
|
+
GitHub Release `vX.Y.Z`: it waits until nuget.org serves the package, builds the wheel from it,
|
|
100
|
+
tests it on Linux and Windows, and uploads it to TestPyPI and then, after the `pypi` environment's
|
|
101
|
+
reviewer approves, to PyPI. `_version.py` must already declare X.Y.Z; no commit is needed after the
|
|
102
|
+
NuGet release, because the wheel build writes the package's SHA-256 into the wheel.
|
|
103
|
+
|
|
104
|
+
## Build and test
|
|
105
|
+
|
|
106
|
+
From `python/pynumerics`:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
python scripts/build_wheel.py --stage-only # stage _bin/Numerics.dll and the Roslyn assemblies
|
|
110
|
+
python -m pip install -e ".[test]"
|
|
111
|
+
python -m pytest # includes tests/test_docs.py: every docs code block
|
|
112
|
+
python scripts/build_wheel.py # build dist/pynumerics-<version>-py3-none-any.whl
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The script takes `Numerics.dll` from `lib/net10.0` of the `RMC.Numerics` package in the
|
|
116
|
+
NuGet global packages folder (or `--nupkg PATH`, or `--download` from nuget.org), or a locally
|
|
117
|
+
built assembly with `--dll PATH`. It reads the version, the assembly version and the SHA-256 of
|
|
118
|
+
that file, refuses a version or assembly version that differs from `src/pynumerics/_version.py`,
|
|
119
|
+
and writes all three into the wheel's `_version.py` (the tracked file keeps `NUMERICS_SHA256`
|
|
120
|
+
empty, so `assert_numerics_identity()` needs an explicit `sha256` in a source checkout). It stages
|
|
121
|
+
`Microsoft.CodeAnalysis.dll` and `Microsoft.CodeAnalysis.CSharp.dll` from `lib/net9.0` of the
|
|
122
|
+
Microsoft.CodeAnalysis.Common and Microsoft.CodeAnalysis.CSharp 4.14.0 packages (NuGet cache, or
|
|
123
|
+
`--download`), each checked against its `ROSLYN_*_SHA256` pin; `--roslyn-only` stages only those.
|
|
124
|
+
To test against a locally built assembly, set `PYNUMERICS_DLL_DIR` to
|
|
125
|
+
`Numerics/bin/Release/net10.0`, or build a wheel from it as the pull request check does:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
dotnet build ../../Numerics/Numerics.csproj -c Release -f net10.0
|
|
129
|
+
python scripts/build_wheel.py --dll ../../Numerics/bin/Release/net10.0/Numerics.dll --download
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The same checks run on Linux in the `.github/docker/linux-test` image, from the repository root:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
docker build -t numerics-linux-test .github/docker/linux-test
|
|
136
|
+
docker run --rm -v "$PWD:/src:ro" -v "$PWD/python/pynumerics/dist:/out" numerics-linux-test
|
|
137
|
+
docker run --rm -v "$PWD/python/pynumerics/dist:/dist:ro" numerics-linux-test identity-check.sh /dist
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The first run builds and tests `Test_Numerics` (net10.0), builds the wheel from that build and runs
|
|
141
|
+
ruff and pytest against it; `CHECKS="wheel pytest"` skips the .NET tests. The second installs the
|
|
142
|
+
wheel in a fresh container and checks the identity of the loaded assembly.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
pynumerics/__init__.py,sha256=dOafW81iFD3vP5Yjh-rwhSsNUV6-3NhIHM-Nur8xTSM,3024
|
|
2
|
+
pynumerics/_coverage.py,sha256=fC0P9_MJ-zvXK0Kt51tuUAJJfPnZAelSvkDlzE8shwA,159546
|
|
3
|
+
pynumerics/_util.py,sha256=_UNGxnnk0H7W6M_A2XnEydbe89JYfXoSrcU1BfCMgw0,9540
|
|
4
|
+
pynumerics/_version.py,sha256=rmJMKTwQcN7iprdircT3aImCrRvIgb9DksEYdrU0pdU,2349
|
|
5
|
+
pynumerics/bootstrap.py,sha256=vVI8qvRU8hFtRUFJKDtvIrMkSL0UtbW0licrZCI9RL4,23113
|
|
6
|
+
pynumerics/callbacks.py,sha256=nBC2G4ky60ppwOy30TvFo8nKxlSbKNh24aOHO5QTxHk,35208
|
|
7
|
+
pynumerics/copulas.py,sha256=hHaTQ7HLS7s9zyu3Nzgp2b6lf7sYCs7m6us0c2idgyo,31530
|
|
8
|
+
pynumerics/data.py,sha256=JtYd-JiJ27znufZ0M0Wmuhi4DbtrQRtV-UBBWLk_yng,75694
|
|
9
|
+
pynumerics/differentiation.py,sha256=758_VFRtIMWaaB2j2pjku0npPsV5tXmHTxzBQkCI-H0,11856
|
|
10
|
+
pynumerics/distributions.py,sha256=DAqWvWZIl_qnr4jVYLAN8YYtVKCIJapHhhtyv9TJpe8,153974
|
|
11
|
+
pynumerics/download.py,sha256=bkACVdW3Z3VPsnWA8j2g5w9m8OKlc9kGjqVchyKGpQ4,25240
|
|
12
|
+
pynumerics/enums.py,sha256=YtZOl1mHQk4yR43V7HQCAohjxyW2ysWk_6NI8zw10L0,3507
|
|
13
|
+
pynumerics/errors.py,sha256=8uH1CQQsH8mgnykbOvyyaBvmdoaLZ5F_qhecbSbTNAI,8861
|
|
14
|
+
pynumerics/functions.py,sha256=wjIXsdiu5gAfWcLabr3iG1IWLg99DmeePPtaVWbGlvA,36782
|
|
15
|
+
pynumerics/goodness_of_fit.py,sha256=ltAjvaEQRK05Iwu2lBWiGDY6TULtpn9EX18olNWxCu0,21556
|
|
16
|
+
pynumerics/graphs.py,sha256=D433cVFgGqpwkQvtogvSmQ4n0EWPsXarUyjHZaEdu1k,20641
|
|
17
|
+
pynumerics/hypothesis_tests.py,sha256=juDu2HwZ18ZuLJXNmkGv6sV28o76nezAUMJlfxb7tLI,14406
|
|
18
|
+
pynumerics/identity.py,sha256=3NOLZ-d1Vglj4lwH5gmgNtFjRTcALSz3Kg1dPyow3NY,4975
|
|
19
|
+
pynumerics/integration.py,sha256=0faKhGFazAgVptFLx_Ulm3Q4ZnoXQp-ZQaMTa319gJY,26697
|
|
20
|
+
pynumerics/linalg.py,sha256=-QICcLbfGcQlP8ghNDut2k-PZa8JCxNK4VboKs9xAOI,44432
|
|
21
|
+
pynumerics/machine_learning.py,sha256=4sZlkDy6cSsYR-wDgOXQE15K48Ra2tfcSuMMyq7Z8Ts,55730
|
|
22
|
+
pynumerics/marshal.py,sha256=ANAEwwswNLwskvuxbbVNpMlJIK8pzzyO6PXuY7lWGWE,29725
|
|
23
|
+
pynumerics/mathematics.py,sha256=uOHarZxvzy8NQSg5MpxPSD_J3Rgq-t_JwSlugAqdXCY,34440
|
|
24
|
+
pynumerics/mcmc.py,sha256=TyapgjflhRo2dbJS96jnk-vyT_qUvrfYYQbzqoSUDow,54847
|
|
25
|
+
pynumerics/multivariate.py,sha256=9f6FYicp0F0OwvbZo2LIxqM8Dn8KgLsqJnGl-CvSwRs,53865
|
|
26
|
+
pynumerics/ode.py,sha256=b9o5MkD3fCyShMrSIjqK8EsoC5qi4iZxvKJT-GYn_ss,5530
|
|
27
|
+
pynumerics/optimization.py,sha256=Ml9vKJzXpoTgtjXPN86L3tsdRF-_ifLLga0CedWhyw0,68816
|
|
28
|
+
pynumerics/probability.py,sha256=tAvrV8bW5YBWOXeS5B7R6k0wKLCoKRVtuQgRon1LtSc,38502
|
|
29
|
+
pynumerics/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
30
|
+
pynumerics/regional.py,sha256=GQSndcYxY8cUcr3QXFjDhjqBL03SrgNbYmoKwHuAoUA,19478
|
|
31
|
+
pynumerics/roots.py,sha256=FQ_ySvg9Mdcywi2MqnCEA6Ajt5rcQqX_DGQ-ohVxzW4,10611
|
|
32
|
+
pynumerics/runtime.py,sha256=ykDBH3ddNclv2tnt3SmR86z9LZnxvm06jP97lIpFNpE,15586
|
|
33
|
+
pynumerics/sampling.py,sha256=gU0Mx5lNDIOnbpCNU4Zc_PlgPDQBFWmc8zHnB14Gx-g,64219
|
|
34
|
+
pynumerics/special.py,sha256=Db_oVF5lPj4lKd1fK2xWj92ML1jh2ILmHj3ezGAVbRY,31382
|
|
35
|
+
pynumerics/statistics.py,sha256=arEPhLLP3Sin11-8hvqpKTakq7-d-5lyBlDbIaLnrtg,67081
|
|
36
|
+
pynumerics/timeseries.py,sha256=6U0j9_DfbpOiPSRWUl3PAcUVXNrK9sH3r9klq4VSOs0,48059
|
|
37
|
+
pynumerics/_bin/Microsoft.CodeAnalysis.CSharp.dll,sha256=UzAqzKB3AOm7ENzyEDRDXW4EVMjuvySBFk7BPlIABMk,6697768
|
|
38
|
+
pynumerics/_bin/Microsoft.CodeAnalysis.LICENSE.txt,sha256=duQve0z_0t1xNkgM5-7WxP4EbY_Nfp41SJi4L_zLmPQ,1387
|
|
39
|
+
pynumerics/_bin/Microsoft.CodeAnalysis.dll,sha256=OVc2stDgK-d77cOEeyadp6k7-OSc00MaSo5o0sUtWEY,3029800
|
|
40
|
+
pynumerics/_bin/Numerics.dll,sha256=aLQ351QaOiy6pinsvDsHSUHvN9pYkZyXzcZlSx5juZI,5522944
|
|
41
|
+
pynumerics/_bin/pynumerics.runtimeconfig.json,sha256=g63qT8IFP6lkG0OCIdPZNdXjJ55wceunvcfebo_heIk,438
|
|
42
|
+
pynumerics-2.3.0.dist-info/licenses/LICENSE,sha256=h4l39CyRqWjAKyAQWGEIMpCyCix2emGLLyro-RM8kkU,607
|
|
43
|
+
pynumerics-2.3.0.dist-info/METADATA,sha256=nupXJn1u9IATE3-ovB4ciW46GK3CU4Kc5kvM4-R8fk8,7416
|
|
44
|
+
pynumerics-2.3.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
45
|
+
pynumerics-2.3.0.dist-info/top_level.txt,sha256=AEhi5LEx-TNiV6TeUF7OlKtg342vH6LpCJakhbW291Y,11
|
|
46
|
+
pynumerics-2.3.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Permission to use, copy, modify, and/or distribute this software for
|
|
2
|
+
any purpose with or without fee is hereby granted.
|
|
3
|
+
|
|
4
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
|
5
|
+
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
|
6
|
+
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
|
|
7
|
+
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
|
|
8
|
+
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
|
|
9
|
+
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
|
|
10
|
+
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pynumerics
|