Esempio n. 1
0
def test_efm_vs_efmset_compute(sigs, M, measure, normed):

    efmset = ef.EFMSet(sigs, measure=measure, normed=normed, coords='epxpypz')
    efms = [
        ef.EFM(*sig, measure=measure, normed=normed, coords='epxpypz')
        for sig in sigs
    ]

    for event in ef.gen_random_events(2, M):
        efm_dict = efmset.compute(event)
        for sig, efm in zip(sigs, efms):
            print(sig, np.max(np.abs(efm_dict[sig] - efm.compute(event))))
            assert epsilon_percent(efm_dict[sig], efm.compute(event), 10**-10)
Esempio n. 2
0
def test_efm_vs_efmset_batch_compute(sigs, M, measure, normed):

    efmset = ef.EFMSet(sigs, measure=measure, normed=normed, coords='epxpypz')
    efms = [
        ef.EFM(*sig, measure=measure, normed=normed, coords='epxpypz')
        for sig in sigs
    ]

    events = ef.gen_random_events(2, M)
    efm_dict = efmset.batch_compute(events)

    for sig, efm in zip(sigs, efms):
        results = efm.batch_compute(events)
        for i in range(len(events)):
            assert epsilon_percent(efm_dict[i][sig], results[i], 10**-10)