Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

refactor: rename pole to real and imag #439

Merged
merged 1 commit into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/expertsystem/amplitude/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ class NonDynamic(Dynamics):

@attr.s
class RelativisticBreitWigner(Dynamics):
pole_position: FitParameter = attr.ib(kw_only=True)
pole_width: FitParameter = attr.ib(kw_only=True)
pole_real: FitParameter = attr.ib(kw_only=True)
pole_imag: FitParameter = attr.ib(kw_only=True)


class ParticleDynamics(abc.MutableMapping):
Expand Down Expand Up @@ -173,17 +173,17 @@ def set_breit_wigner(
if not relativistic:
raise NotImplementedError
particle = self.__particles[particle_name]
pole_position = FitParameter(
pole_real = FitParameter(
name=f"Position_{particle.name}", value=particle.mass
)
pole_width = FitParameter(
pole_imag = FitParameter(
name=f"Width_{particle.name}", value=particle.width
)
self.__register_parameter(pole_position)
self.__register_parameter(pole_width)
self.__register_parameter(pole_real)
self.__register_parameter(pole_imag)
dynamics = RelativisticBreitWigner(
pole_position=pole_position,
pole_width=pole_width,
pole_real=pole_real,
pole_imag=pole_imag,
form_factor=self.__create_form_factor(particle.name),
)
self[particle_name] = dynamics
Expand Down
8 changes: 4 additions & 4 deletions src/expertsystem/io/_dict/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ def __build_dynamics(definition: dict, parameters: FitParameters) -> Dynamics:
if dynamics_type == "RelativisticBreitWigner":
return RelativisticBreitWigner(
form_factor=form_factor,
pole_position=__safely_get_parameter(
definition["pole_position"], parameters
pole_real=__safely_get_parameter(
definition["pole_real"], parameters
),
pole_width=__safely_get_parameter(
definition["pole_width"], parameters
pole_imag=__safely_get_parameter(
definition["pole_imag"], parameters
),
)
raise ValueError(f'Dynamics type "{dynamics_type}" not defined')
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/io/expected_recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,15 @@ dynamics:
meson_radius: *par5
f(0)(980):
type: RelativisticBreitWigner
pole_position: *par6
pole_width: *par7
pole_real: *par6
pole_imag: *par7
form_factor:
type: BlattWeisskopf
meson_radius: *par8
f(0)(1500):
type: RelativisticBreitWigner
pole_position: *par9
pole_width: *par10
pole_real: *par9
pole_imag: *par10
form_factor:
type: BlattWeisskopf
meson_radius: *par11