43def compare_results(egslst, inp_name):
50 doses = extract_all_doses(egslst)
53 for reg, tlen, tlen_unc, edep, edep_unc
in doses:
54 actual[
'tlen'].append((float(tlen), float(tlen_unc)))
55 actual[
'edep'].append((float(edep), float(edep_unc)))
58 for calc_type, region_doses
in list(expected_doses.items()):
59 if calc_type ==
"edep":
60 region_doses = DOSRZ_NRC_DOSES
65 for region, (expected_dose, expected_unc)
in enumerate(region_doses):
67 calc_dose, calc_unc = actual[calc_type][region]
69 doses_close = doses_approx_equal(
70 expected_dose, expected_unc, calc_dose, calc_unc,
71 compare_unc=compare_unc, max_unc_percent_diff=0.5,
75 msg =
"%s dose comparison failed for reg %d: Actual= %E +/- %E Expected= %E +/- %E"
76 print((msg % (calc_type, region + 1, calc_dose, calc_unc, expected_dose, expected_unc)))
79 return all_close, actual, expected_doses