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

Reading an AmplitudeModel without form factors results in an AmplitudeModel with form factors #424

Closed
redeboer opened this issue Jan 8, 2021 · 0 comments · Fixed by #434
Assignees
Labels
Bug Something isn't working

Comments

@redeboer
Copy link
Member

redeboer commented Jan 8, 2021

Bug description

When importing a recipe file without form factors, the resulting AmplitudeModel contains form factors again.

How to reproduce?

import expertsystem as es

result = es.generate_transitions(
    initial_state=("J/psi(1S)", [-1, +1]),
    final_state=["gamma", "pi0", "pi0"],
    allowed_intermediate_particles=["f(0)"],
    allowed_interaction_types="strong and EM",
)
model = es.generate_amplitudes(result)
for name in result.get_intermediate_particles().names:
    model.dynamics.set_breit_wigner(name)

# Set form factors to None
for dyn in model.dynamics.values():
    dyn.form_factor = None

es.io.write(model, "model.yml")
imported_model = es.io.load_amplitude_model("model.yml")

# Check if form factors are still None
for dyn in model.dynamics.values():
    assert dyn.form_factor is None

Expected behavior

In the snippet above

for dyn in model.dynamics.values():
    assert dyn.form_factor == None

should work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant