Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: upgrade to expertsystem 0.6.3 #150

Merged
merged 2 commits into from
Nov 10, 2020
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
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)