24def compare_results(egslst, inp_name):
25 base_gold = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"gold%s.3ddose")
26 base_eb = inp_name+
".phantom%s.3ddose"
27 extensions = [
"",
".to",
".pr",
".ss",
".ms"]
29 gold = [read3ddose(base_gold % e)
for e
in extensions]
30 eb = [read3ddose(base_eb % e)
for e
in extensions]
32 for kind, actual, expected
in zip(extensions, eb, gold):
35 exp_doses, exp_unc = list(zip(*sorted(zip(expected[
'doses'], expected[
'uncs']))))[:NCOMPARE]
38 close = [doses_approx_equal(a, a_unc, e, e_unc, compare_unc=
False, max_percent_diff=0.005)
for a, a_unc, e, e_unc
in zip(act_doses, act_unc, exp_doses, exp_unc)]
39 diffs = [(a-e)/e*100
for a, a_unc, e, e_unc
in zip(act_doses, act_unc, exp_doses, exp_unc)]
42 return False, (kind, act_doses), (kind, exp_doses)