tensorwaves 0.4.15__tar.gz → 0.4.17__tar.gz
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.
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.cspell.json +3 -1
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.github/dependabot.yml +5 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.github/workflows/benchmark.yml +1 -1
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.github/workflows/redirect-gh-pages.yml +2 -2
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.github/workflows/release-drafter.yml +1 -1
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.gitignore +5 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.pre-commit-config.yaml +31 -41
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.vscode/extensions.json +2 -1
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.vscode/settings.json +3 -0
- tensorwaves-0.4.17/PKG-INFO +93 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/benchmarks/expression.py +9 -7
- tensorwaves-0.4.17/benchmarks/precision.py +69 -0
- tensorwaves-0.4.17/benchmarks/unbinned_nll.py +450 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/amplitude-analysis/analytic-continuation.ipynb +4 -5
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/amplitude-analysis.ipynb +8 -6
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/conf.py +10 -4
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/install.md +19 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/usage/basics.ipynb +13 -9
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/usage/binned-fit.ipynb +2 -3
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/usage/caching.ipynb +4 -5
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/usage/chi-squared.ipynb +2 -3
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/usage/faster-lambdify.ipynb +2 -3
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/usage/unbinned-fit.ipynb +2 -3
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/usage.ipynb +2 -3
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/pyproject.toml +297 -263
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/__init__.py +2 -0
- tensorwaves-0.4.17/src/tensorwaves/config.py +119 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/data/__init__.py +10 -4
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/data/phasespace.py +2 -2
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/data/rng.py +7 -6
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/data/transform.py +1 -1
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/estimator.py +20 -12
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/function/__init__.py +1 -1
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/function/_backend.py +20 -15
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/function/sympy/__init__.py +23 -17
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/function/sympy/_printer.py +2 -2
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/interface.py +3 -6
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/optimizer/__init__.py +2 -2
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/optimizer/callbacks.py +126 -10
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/optimizer/minuit.py +1 -5
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/optimizer/scipy.py +3 -8
- tensorwaves-0.4.17/src/tensorwaves/version.py +24 -0
- tensorwaves-0.4.17/src/tensorwaves.egg-info/PKG-INFO +93 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves.egg-info/SOURCES.txt +6 -1
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves.egg-info/requires.txt +2 -0
- tensorwaves-0.4.17/src/tensorwaves.egg-info/scm_file_list.json +100 -0
- tensorwaves-0.4.17/src/tensorwaves.egg-info/scm_version.json +8 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/data/test_transform.py +3 -3
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/function/test_function.py +2 -2
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/function/test_sympy.py +3 -3
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/optimizer/test_fit_simple_model.py +25 -24
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/optimizer/test_gradient.py +46 -1
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/optimizer/test_minuit.py +7 -5
- tensorwaves-0.4.17/tests/test_config.py +176 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/test_estimator.py +1 -1
- tensorwaves-0.4.17/uv.lock +6230 -0
- tensorwaves-0.4.15/.taplo.toml +0 -19
- tensorwaves-0.4.15/PKG-INFO +0 -282
- tensorwaves-0.4.15/src/tensorwaves/version.py +0 -34
- tensorwaves-0.4.15/src/tensorwaves.egg-info/PKG-INFO +0 -282
- tensorwaves-0.4.15/uv.lock +0 -5719
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.binder/apt.txt +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.binder/postBuild +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.binder/runtime.txt +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.editorconfig +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.envrc +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.github/release-drafter.yml +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.github/workflows/cd.yml +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.github/workflows/ci.yml +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.github/workflows/clean-caches.yml +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.github/workflows/lock.yml +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.github/workflows/pr-linting.yml +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.prettierignore +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.python-version +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.readthedocs.yml +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/.vscode/launch.json +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/CITATION.cff +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/CONTRIBUTING.md +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/LICENSE +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/README.md +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/benchmarks/__init__.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/benchmarks/ampform.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/benchmarks/conftest.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/codecov.yml +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/.gitignore +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/_static/favicon.ico +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/_static/linebreaks-api.css +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/index.md +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/docs/tensorflow.txt +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/setup.cfg +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/data/_attrs.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/data/_data_sample.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/optimizer/parameter.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves/py.typed +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves.egg-info/dependency_links.txt +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/src/tensorwaves.egg-info/top_level.txt +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/__init__.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/conftest.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/data/__init__.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/data/test_data.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/data/test_phasespace.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/data/test_rng.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/function/__init__.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/function/test_ampform.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/function/test_backend.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/optimizer/__init__.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/optimizer/test_callbacks.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/optimizer/test_parameter.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/optimizer/test_scipy.py +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/output/.gitignore +0 -0
- {tensorwaves-0.4.15 → tensorwaves-0.4.17}/tests/test_interface.py +0 -0
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
".pre-commit-config.yaml",
|
|
30
30
|
".prettierignore",
|
|
31
31
|
".readthedocs.yml",
|
|
32
|
-
".taplo.toml",
|
|
33
32
|
".vscode/*",
|
|
34
33
|
"CITATION.cff",
|
|
35
34
|
"codecov.yml",
|
|
@@ -125,6 +124,7 @@
|
|
|
125
124
|
"ncalls",
|
|
126
125
|
"ncols",
|
|
127
126
|
"ndarray",
|
|
127
|
+
"njit",
|
|
128
128
|
"noqa",
|
|
129
129
|
"noreply",
|
|
130
130
|
"nrows",
|
|
@@ -134,6 +134,7 @@
|
|
|
134
134
|
"pcolormesh",
|
|
135
135
|
"phasespace",
|
|
136
136
|
"phsp",
|
|
137
|
+
"prange",
|
|
137
138
|
"precommit",
|
|
138
139
|
"prefactor",
|
|
139
140
|
"preorder",
|
|
@@ -240,6 +241,7 @@
|
|
|
240
241
|
"vectorize",
|
|
241
242
|
"venv",
|
|
242
243
|
"weisskopf",
|
|
244
|
+
"wirtinger",
|
|
243
245
|
"xcode",
|
|
244
246
|
"Zenodo",
|
|
245
247
|
"zfit"
|
|
@@ -12,6 +12,11 @@ updates:
|
|
|
12
12
|
labels: [⬆️ Lock]
|
|
13
13
|
multi-ecosystem-group: lock
|
|
14
14
|
patterns: ["*"]
|
|
15
|
+
- package-ecosystem: pre-commit
|
|
16
|
+
directory: "/"
|
|
17
|
+
labels: [⬆️ Lock]
|
|
18
|
+
multi-ecosystem-group: lock
|
|
19
|
+
patterns: ["*"]
|
|
15
20
|
- package-ecosystem: uv
|
|
16
21
|
directory: "/"
|
|
17
22
|
labels: [⬆️ Lock]
|
|
@@ -26,7 +26,7 @@ jobs:
|
|
|
26
26
|
</body>
|
|
27
27
|
</html>' > build/index.html
|
|
28
28
|
- id: deployment
|
|
29
|
-
uses: actions/upload-pages-artifact@
|
|
29
|
+
uses: actions/upload-pages-artifact@v5
|
|
30
30
|
with:
|
|
31
31
|
path: build/
|
|
32
32
|
|
|
@@ -41,4 +41,4 @@ jobs:
|
|
|
41
41
|
runs-on: ubuntu-24.04
|
|
42
42
|
steps:
|
|
43
43
|
- id: deployment
|
|
44
|
-
uses: actions/deploy-pages@
|
|
44
|
+
uses: actions/deploy-pages@v5
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
ci:
|
|
2
2
|
autofix_commit_msg: "MAINT: implement pre-commit autofixes"
|
|
3
3
|
autoupdate_commit_msg: "MAINT: upgrade lock files"
|
|
4
|
+
autoupdate_schedule: quarterly
|
|
4
5
|
skip:
|
|
5
6
|
- check-jsonschema
|
|
7
|
+
- tombi-format
|
|
8
|
+
- tombi-lint
|
|
6
9
|
- ty
|
|
7
10
|
- uv-lock
|
|
8
11
|
|
|
@@ -13,26 +16,12 @@ repos:
|
|
|
13
16
|
- id: check-useless-excludes
|
|
14
17
|
|
|
15
18
|
- repo: https://github.com/ComPWA/policy
|
|
16
|
-
rev: 0.
|
|
19
|
+
rev: 0.9.3
|
|
17
20
|
hooks:
|
|
18
21
|
- id: check-dev-files
|
|
19
|
-
args:
|
|
20
|
-
- --doc-apt-packages=graphviz
|
|
21
|
-
- --excluded-python-versions=3.14
|
|
22
|
-
- --pytest-single-threaded
|
|
23
|
-
- --repo-name=tensorwaves
|
|
24
|
-
- --repo-title=TensorWaves
|
|
25
|
-
- --type-checker=ty
|
|
26
|
-
- id: colab-toc-visible
|
|
27
|
-
- id: fix-nbformat-version
|
|
28
|
-
- id: remove-empty-tags
|
|
29
|
-
- id: set-nb-cells
|
|
30
|
-
args: [--autolink-concat]
|
|
31
|
-
- id: set-nb-display-name
|
|
32
|
-
- id: strip-nb-whitespace
|
|
33
22
|
|
|
34
23
|
- repo: https://github.com/kynan/nbstripout
|
|
35
|
-
rev: 0.9.
|
|
24
|
+
rev: 0.9.1
|
|
36
25
|
hooks:
|
|
37
26
|
- id: nbstripout
|
|
38
27
|
args:
|
|
@@ -59,8 +48,19 @@ repos:
|
|
|
59
48
|
metadata.varInspector
|
|
60
49
|
metadata.vscode
|
|
61
50
|
|
|
51
|
+
- repo: https://github.com/ComPWA/nbhooks
|
|
52
|
+
rev: 0.0.1
|
|
53
|
+
hooks:
|
|
54
|
+
- id: colab-toc-visible
|
|
55
|
+
- id: fix-nbformat-version
|
|
56
|
+
- id: remove-empty-tags
|
|
57
|
+
- id: set-nb-cells
|
|
58
|
+
args: [--autolink-concat]
|
|
59
|
+
- id: set-nb-display-name
|
|
60
|
+
- id: strip-nb-whitespace
|
|
61
|
+
|
|
62
62
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
63
|
-
rev: v0.
|
|
63
|
+
rev: v0.16.1
|
|
64
64
|
hooks:
|
|
65
65
|
- id: ruff-check
|
|
66
66
|
args: [--fix]
|
|
@@ -95,25 +95,20 @@ repos:
|
|
|
95
95
|
)$
|
|
96
96
|
- id: trailing-whitespace
|
|
97
97
|
|
|
98
|
+
- repo: https://github.com/tombi-toml/tombi-pre-commit
|
|
99
|
+
rev: v1.2.6
|
|
100
|
+
hooks:
|
|
101
|
+
- id: tombi-format
|
|
102
|
+
- id: tombi-lint
|
|
103
|
+
args: [--error-on-warnings]
|
|
104
|
+
|
|
98
105
|
- repo: https://github.com/ComPWA/prettier-pre-commit
|
|
99
106
|
rev: v3.8.1
|
|
100
107
|
hooks:
|
|
101
108
|
- id: prettier
|
|
102
109
|
|
|
103
|
-
- repo: https://github.com/ComPWA/taplo-pre-commit
|
|
104
|
-
rev: v0.9.3
|
|
105
|
-
hooks:
|
|
106
|
-
- id: taplo-format
|
|
107
|
-
|
|
108
|
-
- repo: https://github.com/pappasam/toml-sort
|
|
109
|
-
rev: v0.24.3
|
|
110
|
-
hooks:
|
|
111
|
-
- id: toml-sort
|
|
112
|
-
args:
|
|
113
|
-
- --in-place
|
|
114
|
-
|
|
115
110
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
|
116
|
-
rev: 0.
|
|
111
|
+
rev: 0.37.4
|
|
117
112
|
hooks:
|
|
118
113
|
- id: check-jsonschema
|
|
119
114
|
name: Check CITATION.cff
|
|
@@ -126,12 +121,12 @@ repos:
|
|
|
126
121
|
pass_filenames: false
|
|
127
122
|
|
|
128
123
|
- repo: https://github.com/streetsidesoftware/cspell-cli
|
|
129
|
-
rev:
|
|
124
|
+
rev: v10.0.1
|
|
130
125
|
hooks:
|
|
131
126
|
- id: cspell
|
|
132
127
|
|
|
133
128
|
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
|
134
|
-
rev: 3.
|
|
129
|
+
rev: 3.8.0
|
|
135
130
|
hooks:
|
|
136
131
|
- id: editorconfig-checker
|
|
137
132
|
name: editorconfig
|
|
@@ -141,18 +136,13 @@ repos:
|
|
|
141
136
|
.*\.py
|
|
142
137
|
)$
|
|
143
138
|
|
|
144
|
-
- repo:
|
|
139
|
+
- repo: https://github.com/astral-sh/ty-pre-commit
|
|
140
|
+
rev: v0.0.67
|
|
145
141
|
hooks:
|
|
146
142
|
- id: ty
|
|
147
|
-
|
|
148
|
-
entry: ty check
|
|
149
|
-
args: [--no-progress, --output-format=concise]
|
|
150
|
-
pass_filenames: false
|
|
151
|
-
require_serial: true
|
|
152
|
-
language: system
|
|
153
|
-
types_or: [python, pyi, jupyter]
|
|
143
|
+
args: [--group=types, --no-default-groups]
|
|
154
144
|
|
|
155
145
|
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
156
|
-
rev: 0.
|
|
146
|
+
rev: 0.12.1
|
|
157
147
|
hooks:
|
|
158
148
|
- id: uv-lock
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"soulcode.vscode-unwanted-extensions",
|
|
20
20
|
"stkb.rewrap",
|
|
21
21
|
"streetsidesoftware.code-spell-checker",
|
|
22
|
-
"
|
|
22
|
+
"tombi-toml.tombi",
|
|
23
23
|
"yzhang.markdown-all-in-one"
|
|
24
24
|
],
|
|
25
25
|
"unwantedRecommendations": [
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"ms-python.vscode-pylance",
|
|
35
35
|
"ms-toolsai.vscode-jupyter-slideshow",
|
|
36
36
|
"ryanluker.vscode-coverage-gutters",
|
|
37
|
+
"tamasfe.even-better-toml",
|
|
37
38
|
"travisillig.vscode-json-stable-stringify",
|
|
38
39
|
"tyriar.sort-lines"
|
|
39
40
|
]
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tensorwaves
|
|
3
|
+
Version: 0.4.17
|
|
4
|
+
Summary: Python fitter package for multiple computational back-ends
|
|
5
|
+
Author-email: Common Partial Wave Analysis <compwa-admin@ep1.rub.de>
|
|
6
|
+
Maintainer-email: compwa-admin@ep1.rub.de
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Project-URL: Changelog, https://github.com/ComPWA/tensorwaves/releases
|
|
9
|
+
Project-URL: Documentation, https://tensorwaves.rtfd.io
|
|
10
|
+
Project-URL: Issues, https://github.com/ComPWA/tensorwaves/issues
|
|
11
|
+
Project-URL: Source, https://github.com/ComPWA/tensorwaves
|
|
12
|
+
Keywords: HEP,PWA,amplitude analysis,partial wave analysis,particle physics,physics,tensorflow
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Education
|
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
|
17
|
+
Classifier: Natural Language :: English
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
26
|
+
Classifier: Typing :: Typed
|
|
27
|
+
Requires-Python: >=3.10
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: PyYAML>=5.1
|
|
31
|
+
Requires-Dist: attrs>=20.1.0
|
|
32
|
+
Requires-Dist: iminuit>=2.0
|
|
33
|
+
Requires-Dist: numpy
|
|
34
|
+
Requires-Dist: rich
|
|
35
|
+
Requires-Dist: sympy>=1.9
|
|
36
|
+
Requires-Dist: tqdm>=4.24.0
|
|
37
|
+
Provides-Extra: jax
|
|
38
|
+
Requires-Dist: jax; extra == "jax"
|
|
39
|
+
Requires-Dist: jaxlib; extra == "jax"
|
|
40
|
+
Provides-Extra: numba
|
|
41
|
+
Requires-Dist: numba; extra == "numba"
|
|
42
|
+
Provides-Extra: phsp
|
|
43
|
+
Requires-Dist: phasespace[tf]>=1.7.0; extra == "phsp"
|
|
44
|
+
Requires-Dist: tensorwaves[tf]; extra == "phsp"
|
|
45
|
+
Provides-Extra: pwa
|
|
46
|
+
Requires-Dist: ampform[viz]>=0.12.0; extra == "pwa"
|
|
47
|
+
Requires-Dist: tensorwaves[phsp]; extra == "pwa"
|
|
48
|
+
Provides-Extra: scipy
|
|
49
|
+
Requires-Dist: scipy>=1; extra == "scipy"
|
|
50
|
+
Provides-Extra: tf
|
|
51
|
+
Requires-Dist: tensorboard; extra == "tf"
|
|
52
|
+
Requires-Dist: tensorflow>=2.12; extra == "tf"
|
|
53
|
+
Dynamic: license-file
|
|
54
|
+
|
|
55
|
+
# TensorWaves
|
|
56
|
+
|
|
57
|
+
[](https://doi.org/10.5281/zenodo.5526650)
|
|
58
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
59
|
+
|
|
60
|
+
[](https://pypi.org/project/tensorwaves)
|
|
61
|
+
[](https://anaconda.org/conda-forge/tensorwaves)
|
|
62
|
+
[](https://pypi.org/project/tensorwaves)
|
|
63
|
+
|
|
64
|
+
[](https://mybinder.org/v2/gh/ComPWA/tensorwaves/stable?urlpath=lab)
|
|
65
|
+
[](https://colab.research.google.com/github/ComPWA/tensorwaves/blob/stable)
|
|
66
|
+
[](https://open.vscode.dev/ComPWA/tensorwaves)
|
|
67
|
+
|
|
68
|
+
[](https://tensorwaves.readthedocs.io)
|
|
69
|
+
[](https://results.pre-commit.ci/latest/github/ComPWA/tensorwaves/main)
|
|
70
|
+
[](https://github.com/ComPWA/tensorwaves/actions/workflows/ci.yml)
|
|
71
|
+
[](https://codecov.io/gh/ComPWA/tensorwaves)
|
|
72
|
+
[](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
|
|
73
|
+
[](https://github.com/prettier/prettier)
|
|
74
|
+
[](https://github.com/astral-sh/ruff)
|
|
75
|
+
[](https://github.com/astral-sh/uv)
|
|
76
|
+
[](https://github.com/astral-sh/ty)
|
|
77
|
+
|
|
78
|
+
TensorWaves is a fitter package that optimizes mathematical models to data samples. The
|
|
79
|
+
models can be any _symbolic_ mathematical expression that is then converted to any
|
|
80
|
+
computational backend. In addition, TensorWaves provides functionality to generate toy
|
|
81
|
+
Monte Carlo data samples. The package is developed in parallel with
|
|
82
|
+
[AmpForm](https://github.com/ComPWA/ampform), which implements physics models, but its
|
|
83
|
+
'lambdifying' mechanisms can in principle be used independently.
|
|
84
|
+
|
|
85
|
+
All documentation can be found on
|
|
86
|
+
[tensorwaves.rtfd.io](https://tensorwaves.readthedocs.io).
|
|
87
|
+
|
|
88
|
+
For an overview of **upcoming releases and planned functionality**, see
|
|
89
|
+
[here](https://github.com/ComPWA/tensorwaves/milestones?direction=asc&sort=title&state=open).
|
|
90
|
+
|
|
91
|
+
## Contribute
|
|
92
|
+
|
|
93
|
+
See [`CONTRIBUTING.md`](./CONTRIBUTING.md)
|
|
@@ -26,14 +26,16 @@ def poisson(x: sp.Symbol, k) -> sp.Expr:
|
|
|
26
26
|
symbols = sp.symbols("x y (a:c) mu_(:2) sigma_(:2) omega")
|
|
27
27
|
x, y, a, b, c, mu1, mu2, sigma1, sigma2, omega = symbols
|
|
28
28
|
expression = (
|
|
29
|
-
a * gaussian(x, mu1, sigma1)
|
|
29
|
+
a**2 * gaussian(x, mu1, sigma1)
|
|
30
|
+
+ b**2 * gaussian(x, mu2, sigma2)
|
|
31
|
+
+ c**2 * poisson(x, k=2)
|
|
30
32
|
) * sp.cos(y * omega) ** 2
|
|
31
33
|
|
|
32
34
|
domain_boundaries = {"x": (0, 5), "y": (-np.pi, +np.pi)}
|
|
33
35
|
parameter_defaults = {
|
|
34
|
-
a: 0.15,
|
|
35
|
-
b: 0.05,
|
|
36
|
-
c: 0.3,
|
|
36
|
+
a: np.sqrt(0.15),
|
|
37
|
+
b: np.sqrt(0.05),
|
|
38
|
+
c: np.sqrt(0.3),
|
|
37
39
|
mu1: 1.0,
|
|
38
40
|
mu2: 2.7,
|
|
39
41
|
omega: 0.5,
|
|
@@ -41,9 +43,9 @@ parameter_defaults = {
|
|
|
41
43
|
sigma2: 0.5,
|
|
42
44
|
}
|
|
43
45
|
initial_parameters = {
|
|
44
|
-
"a": 0.2,
|
|
45
|
-
"b": 0.1,
|
|
46
|
-
"c": 0.2,
|
|
46
|
+
"a": np.sqrt(0.2),
|
|
47
|
+
"b": np.sqrt(0.1),
|
|
48
|
+
"c": np.sqrt(0.2),
|
|
47
49
|
"mu_0": 0.9,
|
|
48
50
|
"sigma_0": 0.4,
|
|
49
51
|
"sigma_1": 0.4,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
import sympy as sp
|
|
7
|
+
|
|
8
|
+
from tensorwaves import configure
|
|
9
|
+
from tensorwaves.function.sympy import create_function
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from typing import Literal
|
|
13
|
+
|
|
14
|
+
from tensorwaves.config import Precision
|
|
15
|
+
from tensorwaves.interface import DataSample
|
|
16
|
+
|
|
17
|
+
Backend = Literal["jax", "tensorflow"]
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@pytest.mark.benchmark(group="precision")
|
|
21
|
+
@pytest.mark.parametrize("backend", ["jax", "tensorflow"])
|
|
22
|
+
@pytest.mark.parametrize("precision", ["float32", "float64"])
|
|
23
|
+
def test_precision(benchmark, backend: Backend, precision: Precision) -> None:
|
|
24
|
+
_configure_backend(backend, precision)
|
|
25
|
+
x = sp.Symbol("x")
|
|
26
|
+
function = create_function(sp.sin(x) ** 2 + sp.exp(-x), backend=backend)
|
|
27
|
+
data = _create_data(backend)
|
|
28
|
+
result = benchmark(lambda: _evaluate(function, data, backend))
|
|
29
|
+
_assert_precision(backend, precision, data, result)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def _configure_backend(backend: Backend, precision: Precision) -> None:
|
|
33
|
+
if backend == "jax":
|
|
34
|
+
configure(jax_precision=precision)
|
|
35
|
+
else:
|
|
36
|
+
configure(tensorflow_precision=precision)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def _create_data(backend: Backend):
|
|
40
|
+
if backend == "jax":
|
|
41
|
+
import jax.numpy as jnp
|
|
42
|
+
|
|
43
|
+
return {"x": jnp.linspace(0, 10, num=1_000_000).block_until_ready()}
|
|
44
|
+
|
|
45
|
+
import tensorflow.experimental.numpy as tnp # ty: ignore[unresolved-import]
|
|
46
|
+
|
|
47
|
+
return {"x": tnp.linspace(0, 10, num=1_000_000)}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _evaluate(function, data: DataSample, backend: Backend):
|
|
51
|
+
result = function(data)
|
|
52
|
+
if backend == "jax":
|
|
53
|
+
result.block_until_ready()
|
|
54
|
+
return result
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _assert_precision(
|
|
58
|
+
backend: Backend, precision: Precision, data: dict, result
|
|
59
|
+
) -> None:
|
|
60
|
+
assert data["x"].dtype.name == precision
|
|
61
|
+
assert result.dtype.name == precision
|
|
62
|
+
if backend == "jax":
|
|
63
|
+
import jax
|
|
64
|
+
|
|
65
|
+
assert jax.config.x64_enabled == (precision == "float64")
|
|
66
|
+
else:
|
|
67
|
+
import tensorflow.experimental.numpy as tnp # ty: ignore[unresolved-import]
|
|
68
|
+
|
|
69
|
+
assert tnp.asarray(1.0).dtype.name == precision
|