Skip to content

Commit

Permalink
build: allow AmpForm v0.13.x (#419)
Browse files Browse the repository at this point in the history
* chore: update parameter names to AmpForm v0.13.x
* ci: update pip constraints and pre-commit config
* fix: update SymPy type hints
* fix: update vscode and gitpod badges

Co-authored-by: GitHub <noreply@github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Mar 10, 2022
1 parent 4a6510d commit b2e43a6
Show file tree
Hide file tree
Showing 19 changed files with 96 additions and 91 deletions.
8 changes: 4 additions & 4 deletions .constraints/py3.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
absl-py==0.15.0
alabaster==0.7.12
ampform==0.12.6
ampform==0.13.1
anyio==3.5.0
aquirdturtle-collapsible-headings==3.1.0
argon2-cffi==21.3.0
Expand Down Expand Up @@ -86,7 +86,7 @@ jsonschema==3.2.0
jupyter==1.0.0
jupyter-cache==0.4.3
jupyter-client==7.1.2
jupyter-console==6.4.2
jupyter-console==6.4.3
jupyter-core==4.9.2
jupyter-server==1.13.1
jupyter-server-mathjax==0.2.3
Expand Down Expand Up @@ -219,11 +219,11 @@ types-docutils==0.18.0
types-pkg-resources==0.1.3
types-pyyaml==6.0.4
types-requests==2.27.11
types-setuptools==57.4.9
types-setuptools==57.4.10
types-urllib3==1.26.10
typing-extensions==3.7.4.3
urllib3==1.26.8
virtualenv==20.13.2
virtualenv==20.13.3
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.3.1
Expand Down
16 changes: 8 additions & 8 deletions .constraints/py3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
absl-py==1.0.0
alabaster==0.7.12
ampform==0.12.6
ampform==0.13.2
anyio==3.5.0
aquirdturtle-collapsible-headings==3.1.0
argon2-cffi==21.3.0
Expand Down Expand Up @@ -51,7 +51,7 @@ flake8-pytest-style==1.6.0
flake8-rst-docstrings==0.2.5
flake8-use-fstring==1.3
flatbuffers==2.0
fonttools==4.29.1
fonttools==4.30.0
gast==0.4.0
gitdb==4.0.9
gitpython==3.1.27
Expand Down Expand Up @@ -85,12 +85,12 @@ jsonschema==4.4.0
jupyter==1.0.0
jupyter-cache==0.4.3
jupyter-client==7.1.2
jupyter-console==6.4.2
jupyter-console==6.4.3
jupyter-core==4.9.2
jupyter-server==1.13.5
jupyter-server-mathjax==0.2.5
jupyter-sphinx==0.3.2
jupyterlab==3.3.0
jupyterlab==3.3.1
jupyterlab-code-formatter==1.4.10
jupyterlab-markup==1.0.1
jupyterlab-myst==0.1.6 ; python_version >= "3.7.0"
Expand Down Expand Up @@ -208,7 +208,7 @@ sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sphobjinv==2.2.1
sqlalchemy==1.4.32
sympy==1.9
sympy==1.10
tensorboard==2.8.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
Expand All @@ -217,7 +217,7 @@ tensorflow-estimator==2.7.0
tensorflow-io-gcs-filesystem==0.24.0
tensorflow-probability==0.16.0
termcolor==1.1.0
terminado==0.13.2
terminado==0.13.3
testpath==0.6.0
toml==0.10.2
tomli==2.0.1
Expand All @@ -230,11 +230,11 @@ types-docutils==0.18.0
types-pkg-resources==0.1.3
types-pyyaml==6.0.4
types-requests==2.27.11
types-setuptools==57.4.9
types-setuptools==57.4.10
types-urllib3==1.26.10
typing-extensions==4.1.1
urllib3==1.26.8
virtualenv==20.13.2
virtualenv==20.13.3
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.3.1
Expand Down
16 changes: 8 additions & 8 deletions .constraints/py3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
absl-py==1.0.0
alabaster==0.7.12
ampform==0.12.6
ampform==0.13.2
anyio==3.5.0
aquirdturtle-collapsible-headings==3.1.0
argon2-cffi==21.3.0
Expand Down Expand Up @@ -53,7 +53,7 @@ flake8-rst-docstrings==0.2.5
flake8-type-ignore==0.1.0.post2 ; python_version >= "3.8.0"
flake8-use-fstring==1.3
flatbuffers==2.0
fonttools==4.29.1
fonttools==4.30.0
gast==0.4.0
gitdb==4.0.9
gitpython==3.1.27
Expand Down Expand Up @@ -87,12 +87,12 @@ jsonschema==4.4.0
jupyter==1.0.0
jupyter-cache==0.4.3
jupyter-client==7.1.2
jupyter-console==6.4.2
jupyter-console==6.4.3
jupyter-core==4.9.2
jupyter-server==1.13.5
jupyter-server-mathjax==0.2.5
jupyter-sphinx==0.3.2
jupyterlab==3.3.0
jupyterlab==3.3.1
jupyterlab-code-formatter==1.4.10
jupyterlab-markup==1.0.1
jupyterlab-myst==0.1.6 ; python_version >= "3.7.0"
Expand Down Expand Up @@ -211,7 +211,7 @@ sphinxcontrib-serializinghtml==1.1.5
sphobjinv==2.2.1
sqlalchemy==1.4.32
stack-data==0.2.0
sympy==1.9
sympy==1.10
tensorboard==2.8.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
Expand All @@ -220,7 +220,7 @@ tensorflow-estimator==2.7.0
tensorflow-io-gcs-filesystem==0.24.0
tensorflow-probability==0.16.0
termcolor==1.1.0
terminado==0.13.2
terminado==0.13.3
testpath==0.6.0
toml==0.10.2
tomli==2.0.1
Expand All @@ -232,11 +232,11 @@ types-docutils==0.18.0
types-pkg-resources==0.1.3
types-pyyaml==6.0.4
types-requests==2.27.11
types-setuptools==57.4.9
types-setuptools==57.4.10
types-urllib3==1.26.10
typing-extensions==4.1.1
urllib3==1.26.8
virtualenv==20.13.2
virtualenv==20.13.3
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.3.1
Expand Down
16 changes: 8 additions & 8 deletions .constraints/py3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
absl-py==1.0.0
alabaster==0.7.12
ampform==0.12.6
ampform==0.13.2
anyio==3.5.0
aquirdturtle-collapsible-headings==3.1.0
argon2-cffi==21.3.0
Expand Down Expand Up @@ -53,7 +53,7 @@ flake8-rst-docstrings==0.2.5
flake8-type-ignore==0.1.0.post2 ; python_version >= "3.8.0"
flake8-use-fstring==1.3
flatbuffers==2.0
fonttools==4.29.1
fonttools==4.30.0
gast==0.4.0
gitdb==4.0.9
gitpython==3.1.27
Expand Down Expand Up @@ -86,12 +86,12 @@ jsonschema==4.4.0
jupyter==1.0.0
jupyter-cache==0.4.3
jupyter-client==7.1.2
jupyter-console==6.4.2
jupyter-console==6.4.3
jupyter-core==4.9.2
jupyter-server==1.13.5
jupyter-server-mathjax==0.2.5
jupyter-sphinx==0.3.2
jupyterlab==3.3.0
jupyterlab==3.3.1
jupyterlab-code-formatter==1.4.10
jupyterlab-markup==1.0.1
jupyterlab-myst==0.1.6 ; python_version >= "3.7.0"
Expand Down Expand Up @@ -210,7 +210,7 @@ sphinxcontrib-serializinghtml==1.1.5
sphobjinv==2.2.1
sqlalchemy==1.4.32
stack-data==0.2.0
sympy==1.9
sympy==1.10
tensorboard==2.8.0
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
Expand All @@ -219,7 +219,7 @@ tensorflow-estimator==2.7.0
tensorflow-io-gcs-filesystem==0.24.0
tensorflow-probability==0.16.0
termcolor==1.1.0
terminado==0.13.2
terminado==0.13.3
testpath==0.6.0
toml==0.10.2
tomli==2.0.1
Expand All @@ -231,11 +231,11 @@ types-docutils==0.18.0
types-pkg-resources==0.1.3
types-pyyaml==6.0.4
types-requests==2.27.11
types-setuptools==57.4.9
types-setuptools==57.4.10
types-urllib3==1.26.10
typing-extensions==4.1.1
urllib3==1.26.8
virtualenv==20.13.2
virtualenv==20.13.3
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.3.1
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ Bug resulted on the following system:

- OS: <!-- e.g. macOS, WSL Ubuntu, ...-->
- Version <!-- e.g. 10.15, 20.04, ... -->
- Python version: <!-- e.g. 3.6, 3.7, ... -->
- Python version: <!-- e.g. 3.7, 3.8, ... -->
- Virtual environment: <!-- e.g. venv, Conda, pip user install, ... -->
2 changes: 0 additions & 2 deletions .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-sphinx.*]
ignore_missing_imports = True
[mypy-sympy.*]
ignore_missing_imports = True
[mypy-tensorflow.*]
ignore_missing_imports = True
[mypy-tqdm.*]
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.0.114
rev: 0.0.118
hooks:
- id: check-dev-files
args:
Expand Down Expand Up @@ -92,7 +92,7 @@ repos:
- id: markdownlint

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.3.0
rev: 1.3.1
hooks:
- id: nbqa-black
additional_dependencies:
Expand Down Expand Up @@ -140,7 +140,7 @@ repos:
- id: pydocstyle

- repo: https://github.com/ComPWA/mirrors-pyright
rev: v1.1.227
rev: v1.1.228
hooks:
- id: pyright

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# How to contribute?

[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/ComPWA/tensorwaves)
[![GitPod](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ComPWA/tensorwaves)
[![Open in Visual Studio Code](https://img.shields.io/badge/vscode-open-blue?logo=visualstudiocode)](https://open.vscode.dev/ComPWA/tensorwaves)
[![GitPod](https://img.shields.io/badge/gitpod-open-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ComPWA/tensorwaves)

This package is part of the [ComPWA Organization](https://github.com/ComPWA).
For more information about how to contribute to the packages, go to
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

[![Binder](https://static.mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ComPWA/tensorwaves/stable?filepath=docs/usage)
[![Google Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ComPWA/tensorwaves/blob/stable)
[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/ComPWA/tensorwaves)
[![GitPod](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ComPWA/tensorwaves)
[![Open in Visual Studio Code](https://img.shields.io/badge/vscode-open-blue?logo=visualstudiocode)](https://open.vscode.dev/ComPWA/tensorwaves)
[![GitPod](https://img.shields.io/badge/gitpod-open-blue?logo=gitpod)](https://gitpod.io/#https://github.com/ComPWA/tensorwaves)

[![Documentation build status](https://readthedocs.org/projects/tensorwaves/badge/?version=latest)](https://tensorwaves.readthedocs.io)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/ComPWA/tensorwaves/main.svg)](https://results.pre-commit.ci/latest/github/ComPWA/tensorwaves/main)
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/ampform.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ def test_fit(self, backend, benchmark, model, size):
coefficient_name = coefficients[1]
initial_parameters = {
coefficient_name: 1.0 + 0.0j,
"Gamma_f(0)(500)": 0.3,
"m_f(0)(980)": 1,
"m_{f_{0}(980)}": 1,
R"\Gamma_{f_{0}(500)}": 0.3,
}
fit_result = benchmark(
fit, data, phsp, function, initial_parameters, backend
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def gaussian(x: sp.Symbol, mu: sp.Symbol, sigma: sp.Symbol) -> sp.Expr:
return sp.exp(-(((x - mu) / sigma) ** 2) / 2)


def poisson(x: sp.Symbol, k: sp.Symbol) -> sp.Expr:
def poisson(x: sp.Symbol, k) -> sp.Expr:
return x**k * sp.exp(-x) / sp.factorial(k)


Expand Down
46 changes: 24 additions & 22 deletions docs/amplitude-analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -815,20 +815,22 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"initial_parameters = {\n",
" R\"C_{J/\\psi(1S) \\to f_{0}(1500)_{0} \\gamma_{+1}; f_{0}(1500) \\to \\pi^{0}_{0} \\pi^{0}_{0}}\": 1.0\n",
" R\"C_{J/\\psi(1S) \\to {f_{0}(1500)}_{0} \\gamma_{+1}; f_{0}(1500) \\to \\pi^{0}_{0} \\pi^{0}_{0}}\": 1.0\n",
" + 0.0j,\n",
" \"m_f(0)(500)\": 0.4,\n",
" \"m_f(0)(980)\": 0.88,\n",
" \"m_f(0)(1370)\": 1.22,\n",
" \"m_f(0)(1500)\": 1.45,\n",
" \"m_f(0)(1710)\": 1.83,\n",
" \"Gamma_f(0)(500)\": 0.3,\n",
" \"Gamma_f(0)(980)\": 0.1,\n",
" \"Gamma_f(0)(1710)\": 0.3,\n",
" \"m_{f_{0}(500)}\": 0.4,\n",
" \"m_{f_{0}(980)}\": 0.88,\n",
" \"m_{f_{0}(1370)}\": 1.22,\n",
" \"m_{f_{0}(1500)}\": 1.45,\n",
" \"m_{f_{0}(1710)}\": 1.83,\n",
" R\"\\Gamma_{f_{0}(500)}\": 0.3,\n",
" R\"\\Gamma_{f_{0}(980)}\": 0.1,\n",
" R\"\\Gamma_{f_{0}(1710)}\": 0.3,\n",
"}"
]
},
Expand Down Expand Up @@ -1717,8 +1719,8 @@
"outputs": [],
"source": [
"model.components[\n",
" R\"A_{J/\\psi(1S)_{+1} \\to f_{0}(1370)_{0} \\gamma_{+1}; f_{0}(1370)_{0} \\to\"\n",
" R\" \\pi^{0}_{0} \\pi^{0}_{0}}\"\n",
" R\"A_{J/\\psi(1S)_{+1} \\to {f_{0}(1370)}_{0} \\gamma_{+1};\"\n",
" R\" {f_{0}(1370)}_{0} \\to \\pi^{0}_{0} \\pi^{0}_{0}}\"\n",
"].subs(model.parameter_defaults).doit()"
]
},
Expand All @@ -1739,16 +1741,16 @@
"source": [
"added_components = model.sum_components(\n",
" components=[\n",
" R\"A_{J/\\psi(1S)_{+1} \\to f_{0}(500)_{0} \\gamma_{+1}; f_{0}(500)_{0}\"\n",
" R\" \\to \\pi^{0}_{0} \\pi^{0}_{0}}\",\n",
" R\"A_{J/\\psi(1S)_{+1} \\to f_{0}(980)_{0} \\gamma_{+1}; f_{0}(980)_{0}\"\n",
" R\" \\to \\pi^{0}_{0} \\pi^{0}_{0}}\",\n",
" R\"A_{J/\\psi(1S)_{+1} \\to f_{0}(1370)_{0} \\gamma_{+1}; f_{0}(1370)_{0}\"\n",
" R\" \\to \\pi^{0}_{0} \\pi^{0}_{0}}\",\n",
" R\"A_{J/\\psi(1S)_{+1} \\to f_{0}(1500)_{0} \\gamma_{+1}; f_{0}(1500)_{0}\"\n",
" R\" \\to \\pi^{0}_{0} \\pi^{0}_{0}}\",\n",
" R\"A_{J/\\psi(1S)_{+1} \\to f_{0}(1710)_{0} \\gamma_{+1}; f_{0}(1710)_{0}\"\n",
" R\" \\to \\pi^{0}_{0} \\pi^{0}_{0}}\",\n",
" R\"A_{J/\\psi(1S)_{+1} \\to {f_{0}(500)}_{0} \\gamma_{+1};\"\n",
" R\" {f_{0}(500)}_{0} \\to \\pi^{0}_{0} \\pi^{0}_{0}}\",\n",
" R\"A_{J/\\psi(1S)_{+1} \\to {f_{0}(980)}_{0} \\gamma_{+1};\"\n",
" R\" {f_{0}(980)}_{0} \\to \\pi^{0}_{0} \\pi^{0}_{0}}\",\n",
" R\"A_{J/\\psi(1S)_{+1} \\to {f_{0}(1370)}_{0} \\gamma_{+1};\"\n",
" R\" {f_{0}(1370)}_{0} \\to \\pi^{0}_{0} \\pi^{0}_{0}}\",\n",
" R\"A_{J/\\psi(1S)_{+1} \\to {f_{0}(1500)}_{0} \\gamma_{+1};\"\n",
" R\" {f_{0}(1500)}_{0} \\to \\pi^{0}_{0} \\pi^{0}_{0}}\",\n",
" R\"A_{J/\\psi(1S)_{+1} \\to {f_{0}(1710)}_{0} \\gamma_{+1};\"\n",
" R\" {f_{0}(1710)}_{0} \\to \\pi^{0}_{0} \\pi^{0}_{0}}\",\n",
" ]\n",
")"
]
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ phasespace =
%(phsp)s
pwa =
%(phsp)s
ampform ==0.12.*
ampform >=0.12.0, <0.14 # https://github.com/ComPWA/ampform/pull/177
scipy =
scipy >=1
viz =
Expand Down Expand Up @@ -105,6 +105,7 @@ test-types =
pytest-mock >=3.3.0
test =
%(test-types)s
ampform >=0.13 # https://github.com/ComPWA/ampform/issues/208
coverage!=6.3 # https://github.com/ComPWA/tensorwaves/runs/4988761243
nbmake
pytest-benchmark
Expand Down
Loading

0 comments on commit b2e43a6

Please sign in to comment.