Skip to content

Commit

Permalink
All tests in test_all_cms.py pass
Browse files Browse the repository at this point in the history
  • Loading branch information
jncots authored and HDembinski committed Aug 15, 2022
1 parent a6130ce commit 7a7ff70
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ define \n

endef

SUBDIRS = EPOS-LHC pythia6 qgsjet sophia sibyll dpmjet3.0-6 \
dpmjetIII-19.1 dpmjetIII-19.3 urqmd-3.4
SUBDIRS = EPOS-LHC pythia6 qgsjet sophia sibyll dpmjet3.0-6 dpmjetIII-19.1 dpmjetIII-19.3 urqmd-3.4

all: $(SUBDIRS)

Expand Down
21 changes: 16 additions & 5 deletions tests/test_all_cms.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< HEAD:tests/test_all_cms.py
import numpy as np
from multiprocessing import Pool, freeze_support, TimeoutError
import tempfile
Expand All @@ -17,14 +18,23 @@ def run_generator(model, nevents):
event_kinematics = EventKinematics(elab=7000 * GeV, p1pdg=22, p2pdg=2212)
impy_config["user_frame"] = "center-of-mass"
else:

if (model.__name__== "Sophia20"):
event_kinematics = EventKinematics(
ecm=7000 * GeV,
p1pdg=2212,
elab=7000 * GeV,
p1pdg=22,
p2pdg=2212
# nuc2_prop=(14,7)
)

impy_config["user_frame"] = "center-of-mass"
else:
event_kinematics = EventKinematics(
ecm=7000 * GeV,
p1pdg=2212,
p2pdg=2212
# nuc2_prop=(14,7)
)

impy_config["user_frame"] = "center-of-mass"

model_name = model.__name__

Expand Down Expand Up @@ -64,7 +74,7 @@ def test_all_cms():
models.append(obj)

result = []
with Pool(1, maxtasksperchild=1) as pool:
with Pool(1, maxtasksperchild = 1) as pool:
jobs = [pool.apply_async(run_generator, (model, 100)) for model in models]
for job in jobs:
try:
Expand All @@ -89,3 +99,4 @@ def test_all_cms():
pickle.dump((eta_bins, psrap, logs), f)

assert failed == set()
>>>>>>> 914028d (All tests in test_all_cms.py pass):impy/tests/test_all_cms.py

0 comments on commit 7a7ff70

Please sign in to comment.