Skip to content

Commit

Permalink
build: upgrade to expertsystem 0.6.3 (#150)
Browse files Browse the repository at this point in the history
* test: use expertsystem facade functions
  • Loading branch information
redeboer committed Nov 10, 2020
1 parent 8b5d6a7 commit d46608a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
# Intersphinx settings
intersphinx_mapping = {
"expertsystem": (
"https://pwa.readthedocs.io/projects/expertsystem/en/0.6.2",
"https://pwa.readthedocs.io/projects/expertsystem/en/0.6.3",
None,
),
"iminuit": ("https://iminuit.readthedocs.io/en/latest", None),
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 @@ setup_requires =
setuptools_scm
install_requires =
amplitf==0.0.1a2
expertsystem==0.6.2
expertsystem==0.6.3
iminuit==1.4.5
numpy==1.18.0
pandas==1.0.5
Expand Down
29 changes: 7 additions & 22 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import expertsystem as es
import pytest
from expertsystem import io
from expertsystem.amplitude.canonical_decay import CanonicalAmplitudeGenerator
from expertsystem.amplitude.helicity_decay import HelicityAmplitudeGenerator
from expertsystem.amplitude.model import AmplitudeModel
from expertsystem.particle import ParticleCollection
from expertsystem.reaction import InteractionTypes, StateTransitionManager


@pytest.fixture(scope="session")
def pdg() -> ParticleCollection:
return io.load_pdg()
return es.io.load_pdg()


@pytest.fixture(scope="session")
Expand All @@ -28,25 +25,13 @@ def canonical_model() -> AmplitudeModel:


def __create_model(formalism: str) -> AmplitudeModel:
stm = StateTransitionManager(
initial_state=[("J/psi(1S)")],
final_state=[("gamma"), ("pi0"), ("pi0")],
result = es.generate_transitions(
initial_state=("J/psi(1S)", [-1, +1]),
final_state=["gamma", "pi0", "pi0"],
allowed_intermediate_particles=["f(0)(980)"],
formalism_type=formalism,
topology_building="isobar",
allowed_interaction_types=["EM", "strong"],
number_of_threads=1,
)

stm.set_allowed_interaction_types([InteractionTypes.Strong])
graph_interaction_settings_groups = stm.prepare_graphs()
result = stm.find_solutions(graph_interaction_settings_groups)

if formalism == "helicity":
amplitude_generator = HelicityAmplitudeGenerator()
elif formalism == "canonical-helicity":
amplitude_generator = CanonicalAmplitudeGenerator()
else:
raise NotImplementedError(f"No amplitude generator for {formalism}")

amplitude_model = amplitude_generator.generate(result)
return amplitude_model
return es.generate_amplitudes(result)

0 comments on commit d46608a

Please sign in to comment.