Skip to content

Commit

Permalink
build: upgrade to AmpForm v0.9.x (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed May 10, 2021
1 parent 82c2b35 commit 66e24e0
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .constraints/py3.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
absl-py==0.12.0
alabaster==0.7.12
ampform==0.8.1
ampform==0.9.1
anyio==2.2.0
apipkg==1.5
appdirs==1.4.4
Expand Down Expand Up @@ -94,7 +94,7 @@ jupyter-server==1.6.4
jupyter-sphinx==0.3.2
jupyter==1.0.0
jupyterlab-code-formatter==1.4.10
jupyterlab-server==2.5.0
jupyterlab-server==2.5.1
jupyterlab-widgets==1.0.0
jupyterlab==3.0.14
keras-preprocessing==1.1.2
Expand Down
4 changes: 2 additions & 2 deletions .constraints/py3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
absl-py==0.12.0
alabaster==0.7.12
ampform==0.8.1
ampform==0.9.1
anyio==2.2.0
apipkg==1.5
appdirs==1.4.4
Expand Down Expand Up @@ -91,7 +91,7 @@ jupyter-server==1.6.4
jupyter-sphinx==0.3.2
jupyter==1.0.0
jupyterlab-code-formatter==1.4.10
jupyterlab-server==2.5.0
jupyterlab-server==2.5.1
jupyterlab-widgets==1.0.0
jupyterlab==3.0.14
keras-preprocessing==1.1.2
Expand Down
4 changes: 2 additions & 2 deletions .constraints/py3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
absl-py==0.12.0
alabaster==0.7.12
ampform==0.8.1
ampform==0.9.1
anyio==2.2.0
apipkg==1.5
appdirs==1.4.4
Expand Down Expand Up @@ -91,7 +91,7 @@ jupyter-server==1.6.4
jupyter-sphinx==0.3.2
jupyter==1.0.0
jupyterlab-code-formatter==1.4.10
jupyterlab-server==2.5.0
jupyterlab-server==2.5.1
jupyterlab-widgets==1.0.0
jupyterlab==3.0.14
keras-preprocessing==1.1.2
Expand Down
2 changes: 1 addition & 1 deletion docs/usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"outputs": [],
"source": [
"model.components[\n",
" R\"A[J/\\psi(1S)_{-1} \\to f_{0}(980)_{0} \\gamma_{+1,L=2,S=1};f_{0}(980)_{0} \\to \\pi^{0}_{0} \\pi^{0}_{0,L=0,S=0};]\"\n",
" R\"A[J/\\psi(1S)_{-1} \\to f_{0}(980)_{0} \\gamma_{+1,L=2,S=1}; f_{0}(980)_{0} \\to \\pi^{0}_{0} \\pi^{0}_{0,L=0,S=0}]\"\n",
"].doit()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/step1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"1. The coefficients for the different amplitudes are **complex** valued.\n",
"2. By default there is no dynamics in the model, so it still has to be specified.\n",
"\n",
"We choose to use {func}`~ampform.dynamics.lineshape.relativistic_breit_wigner_with_ff` as the lineshape for all resonances and use a {class}`~ampform.dynamics.lineshape.BlattWeisskopf` form factor factor (no dynamics) for the production decay. The {meth}`~ampform.helicity.HelicityAmplitudeBuilder.set_dynamics` is a convenience interface for replacing the dynamics for intermediate states."
"We choose to use {func}`~ampform.dynamics.relativistic_breit_wigner_with_ff` as the lineshape for all resonances and use a Blatt-Weisskopf form factor (no dynamics; see {class}`~ampform.dynamics.BlattWeisskopfSquared`) for the production decay. The {meth}`~ampform.helicity.HelicityAmplitudeBuilder.set_dynamics` is a convenience interface for replacing the dynamics for intermediate states."
]
},
{
Expand Down
14 changes: 7 additions & 7 deletions docs/usage/step3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"outputs": [],
"source": [
"initial_parameters = {\n",
" \"C[J/\\\\psi(1S) \\\\to f_{0}(1500)_{0} \\\\gamma_{+1};f_{0}(1500) \\\\to \\\\pi^{0}_{0} \\\\pi^{0}_{0}]\": 1.0\n",
" \"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",
" \"Gamma_f(0)(980)\": 0.15,\n",
" \"Gamma_f(0)(1500)\": 0.2,\n",
Expand Down Expand Up @@ -576,7 +576,7 @@
"outputs": [],
"source": [
"model.components[\n",
" R\"A[J/\\psi(1S)_{+1} \\to f_{0}(1370)_{0} \\gamma_{+1};f_{0}(1370)_{0} \\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} \\to \\pi^{0}_{0} \\pi^{0}_{0}]\"\n",
"].subs(model.parameter_defaults).doit()"
]
},
Expand All @@ -598,11 +598,11 @@
"from_amplitudes = create_intensity_component(\n",
" model,\n",
" components=[\n",
" R\"A[J/\\psi(1S)_{+1} \\to f_{0}(500)_{0} \\gamma_{+1};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};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};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};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};f_{0}(1710)_{0} \\to \\pi^{0}_{0} \\pi^{0}_{0}]\",\n",
" R\"A[J/\\psi(1S)_{+1} \\to f_{0}(500)_{0} \\gamma_{+1}; 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}; 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}; 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}; 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}; f_{0}(1710)_{0} \\to \\pi^{0}_{0} \\pi^{0}_{0}]\",\n",
" ],\n",
" backend=\"numpy\",\n",
")\n",
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ python_requires = >=3.6, <3.9
setup_requires =
setuptools_scm
install_requires =
ampform == 0.8.*
ampform >= 0.8, < 0.10
iminuit >= 2.0
numpy
phasespace >= 1.2.0
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def estimator(
def free_parameters() -> Dict[str, ParameterValue]:
# pylint: disable=line-too-long
return {
"C[J/\\psi(1S) \\to f_{0}(980)_{0} \\gamma_{+1};f_{0}(980) \\to \\pi^{0}_{0} \\pi^{0}_{0}]": 1.0
R"C[J/\psi(1S) \to f_{0}(980)_{0} \gamma_{+1}; f_{0}(980) \to \pi^{0}_{0} \pi^{0}_{0}]": 1.0
+ 0.0j,
"Gamma_f(0)(500)": 0.3,
"m_f(0)(980)": 1,
Expand Down
10 changes: 5 additions & 5 deletions tests/test_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pylint: disable=redefined-outer-name
# pylint: disable=line-too-long, redefined-outer-name
import numpy as np
import pytest
import sympy as sp
Expand Down Expand Up @@ -52,8 +52,8 @@ def test_complex_amplitude(

def test_canonical(canonical_model: SympyModel):
assert set(canonical_model.parameters) == {
"C[J/\\psi(1S) \\to f_{0}(980)_{0} \\gamma_{+1};f_{0}(980) \\to \\pi^{0}_{0} \\pi^{0}_{0}]",
"C[J/\\psi(1S) \\to f_{0}(500)_{0} \\gamma_{+1};f_{0}(500) \\to \\pi^{0}_{0} \\pi^{0}_{0}]",
R"C[J/\psi(1S) \to f_{0}(980)_{0} \gamma_{+1}; f_{0}(980) \to \pi^{0}_{0} \pi^{0}_{0}]",
R"C[J/\psi(1S) \to f_{0}(500)_{0} \gamma_{+1}; f_{0}(500) \to \pi^{0}_{0} \pi^{0}_{0}]",
"m_f(0)(980)",
"Gamma_f(0)(980)",
"m_f(0)(500)",
Expand All @@ -63,8 +63,8 @@ def test_canonical(canonical_model: SympyModel):

def test_helicity(helicity_model: SympyModel):
assert set(helicity_model.parameters) == {
"C[J/\\psi(1S) \\to f_{0}(980)_{0} \\gamma_{+1};f_{0}(980) \\to \\pi^{0}_{0} \\pi^{0}_{0}]",
"C[J/\\psi(1S) \\to f_{0}(500)_{0} \\gamma_{+1};f_{0}(500) \\to \\pi^{0}_{0} \\pi^{0}_{0}]",
R"C[J/\psi(1S) \to f_{0}(980)_{0} \gamma_{+1}; f_{0}(980) \to \pi^{0}_{0} \pi^{0}_{0}]",
R"C[J/\psi(1S) \to f_{0}(500)_{0} \gamma_{+1}; f_{0}(500) \to \pi^{0}_{0} \pi^{0}_{0}]",
"m_f(0)(980)",
"Gamma_f(0)(980)",
"m_f(0)(500)",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def test_create_intensity_component(
from_amplitudes = create_intensity_component(
model,
components=[
R"A[J/\psi(1S)_{+1} \to f_{0}(500)_{0} \gamma_{+1};f_{0}(500)_{0} \to \pi^{0}_{0} \pi^{0}_{0}]",
R"A[J/\psi(1S)_{+1} \to f_{0}(980)_{0} \gamma_{+1};f_{0}(980)_{0} \to \pi^{0}_{0} \pi^{0}_{0}]",
R"A[J/\psi(1S)_{+1} \to f_{0}(500)_{0} \gamma_{+1}; f_{0}(500)_{0} \to \pi^{0}_{0} \pi^{0}_{0}]",
R"A[J/\psi(1S)_{+1} \to f_{0}(980)_{0} \gamma_{+1}; f_{0}(980)_{0} \to \pi^{0}_{0} \pi^{0}_{0}]",
],
backend="numpy",
)
Expand Down

0 comments on commit 66e24e0

Please sign in to comment.