impy-project / chromo

Hadronic Interaction Model interface in PYthon
Other
31 stars 7 forks source link

test_generator[Sibyll23StarMixed] failed #173

Closed gaudu closed 1 year ago

gaudu commented 1 year ago

I installed chromo from the main branch and got this error message while running the test 😸

______________________________________________________ test_generator[Sibyll23StarMixed] _______________________________________________________
[gw9] linux -- Python 3.10.12 /usr/bin/python

Model = <class 'chromo.models.sibyll.Sibyll23StarMixed'>

    @pytest.mark.skipif(
        "CI" in os.environ and platform.system() == "Windows",
        reason="skip to speed up CI on Windows",
    )
    @pytest.mark.parametrize("Model", get_all_models())
    def test_generator(Model):
        if Model is im.Sophia20:
            kin = CenterOfMass(1000 * GeV, "gamma", "p")
        else:
            kin = CenterOfMass(1000 * GeV, "p", "p")
        counts = run_in_separate_process(
            run_model, Model, kin, 1000 if Model in (im.EposLHC, im.UrQMD34) else 20000
        )

        # Known issues:
        # SIBYLL-2.1 and UrQMD produce no Omega-
        # QGSJet family procues no Omega-, Xi0, Xi-, Sigma+, Sigma-
        known_issues = np.zeros_like(counts, dtype=bool)
        if Model == im.Sibyll21:
            for i, pid in enumerate(long_lived_hadrons):
                if abs(pid) == lp.Omega_minus.pdgid:
                    known_issues[i] = True
        elif Model == im.UrQMD34:
            for i, pid in enumerate(long_lived_hadrons):
                if pid == lp.Omega_minus.pdgid:
                    known_issues[i] = True
        elif Model.pyname.startswith("QGSJet"):
            for i, pid in enumerate(long_lived_hadrons):
                if abs(pid) in (
                    lp.Omega_minus.pdgid,
                    lp.Xi_0.pdgid,
                    lp.Xi_minus.pdgid,
                    lp.Sigma_plus.pdgid,
                    lp.Sigma_minus.pdgid,
                ):
                    known_issues[i] = True

        msg = f"{Model.pyname} zero counts for "
        msg += ", ".join(
            pdg2name(pid)
            for pid, n, ki in zip(long_lived_hadrons, counts, known_issues)
            if n == 0 and not ki
        )
        test = np.all((counts > 0) ^ known_issues)
>       assert test, (
            msg
            + ", ".join(
                f"{pid} {n} {ki}"
                for pid, n, ki in zip(long_lived_hadrons, counts, known_issues)
            )
            + f"__: {(counts > 0) ^ known_issues}"
        )
E       AssertionError: Sibyll23StarMixed zero counts for Omega~+, Xi~0, Xi~+, Xi-, Xi0, Omega-2112 27491 False, 130 27728 False, 211 244736 False, 310 27554 False, 321 28965 False, -3334 0 False, -3322 0 False, -3312 0 False, -3222 1795 False, -3122 5876 False, -3112 1762 False, 3112 1725 False, 3122 8684 False, 3222 3300 False, 3312 0 False, 3322 0 False, 3334 0 False, -321 26585 False, -211 233154 False, -2112 16256 False__: [ True  True  True  True  True False False False  True  True  True  True
E           True  True False False False  True  True  True]
E       assert False

tests/test_final_state.py:69: AssertionError
afedynitch commented 1 year ago

Hi!

We know about it. The next PR #167 will fix it.