Skip to content

Commit

Permalink
ENH: add set_dynamics() method for backward compatibility (#400)
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer authored Mar 4, 2024
1 parent 3e26e8d commit 7620b30
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/ampform/helicity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import logging
import operator
import sys
import warnings
from collections import OrderedDict, abc
from functools import reduce
from typing import (
Expand Down Expand Up @@ -377,6 +378,22 @@ def naming(self) -> NameGenerator:
def reaction(self) -> ReactionInfo:
return self.__reaction

def set_dynamics(
self, particle_name: str, dynamics_builder: ResonanceDynamicsBuilder
) -> None:
"""Assign a `.ResonanceDynamicsBuilder` for a specific resonance.
.. deprecated:: 0.16.0
Use the `~.DynamicsSelector.assign()` method of the `.dynamics` attribute
instead.
"""
warnings.warn(
"set_dynamics() will be removed in favor of dynamics.assign()",
category=DeprecationWarning,
stacklevel=1,
)
self.dynamics.assign(particle_name, dynamics_builder)

def formulate(self) -> HelicityModel:
self.__ingredients.reset()
main_intensity = self.__formulate_top_expression()
Expand Down

0 comments on commit 7620b30

Please sign in to comment.