Skip to content

Commit

Permalink
fix: return meson radius of value 1 (#275)
Browse files Browse the repository at this point in the history
* test: check types of HelicityModel.parameter_defaults
  • Loading branch information
redeboer authored Apr 7, 2022
1 parent 9d5d931 commit 765299d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ampform/dynamics/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def create_non_dynamic_with_ff(
)
return (
form_factor,
{meson_radius: sp.S.One},
{meson_radius: 1},
)


Expand Down Expand Up @@ -205,7 +205,7 @@ def __energy_dependent_breit_wigner(
parameter_defaults = {
res_mass: resonance.mass,
res_width: resonance.width,
meson_radius: sp.S.One,
meson_radius: 1,
}
return breit_wigner_expr, parameter_defaults

Expand All @@ -228,9 +228,9 @@ def __create_form_factor(
meson_radius=meson_radius,
)
parameter_defaults = {
meson_radius: sp.S.One,
meson_radius: 1,
}
return form_factor, parameter_defaults
return form_factor, parameter_defaults # type: ignore[return-value]

@staticmethod
def __create_symbols(
Expand Down
9 changes: 9 additions & 0 deletions tests/helicity/test_helicity.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from ampform.helicity import (
HelicityAmplitudeBuilder,
HelicityModel,
ParameterValue,
ParameterValues,
_generate_kinematic_variables,
formulate_wigner_d,
Expand Down Expand Up @@ -170,6 +171,14 @@ def test_use_helicity_couplings(self, reaction: ReactionInfo):


class TestHelicityModel:
def test_parameter_defaults_item_types(
self, amplitude_model: tuple[str, HelicityModel]
):
_, model = amplitude_model
for symbol, value in model.parameter_defaults.items():
assert isinstance(symbol, sp.Symbol)
assert isinstance(value, ParameterValue.__args__) # type: ignore[attr-defined]

def test_rename_symbols_no_renames(
self, amplitude_model: tuple[str, HelicityModel]
):
Expand Down

0 comments on commit 765299d

Please sign in to comment.