37 def event(self):
38 """check the extra info names are what we expect!"""
39 for multiclass in [False, True]:
40 for multiexpert_prefix in ['multi_', '']:
41 for name, value in [('low_never', 0.5),
42 ('low_always', 0.0),
43 ('low_higher', 0.5),
44 ('low_lower', 0.0),
45
46 ('high_never', 0.5),
47 ('high_always', 1.0),
48 ('high_higher', 1.0),
49 ('high_lower', 0.5)]:
50 name = multiexpert_prefix+name
51 if multiclass:
52 for index in range(3):
53 compare_val = index + value
54 extra_info_name = f'multiclass_{name}_{index}'
55
56 for p in self.plist:
57 ei_value = p.getExtraInfo(extra_info_name)
58 assert ei_value == compare_val,\
59 f'ExtraInfo "{extra_info_name}" value "{ei_value}" not what was expected {compare_val}'
60
61 for p in self.comp_plist:
62 if 'multi_' in extra_info_name:
63 continue
64 ei_value = p.getDaughter(0).getExtraInfo(extra_info_name)
65 assert ei_value == compare_val,\
66 f'ExtraInfo "{extra_info_name}" value "{ei_value}" not what was expected {compare_val}'
67
68 ei_value = self.eventExtraInfo.getExtraInfo(extra_info_name)
69 assert ei_value == compare_val,\
70 f'eventExtraInfo "{extra_info_name}" value "{ei_value}" not what was expected {compare_val}'
71 else:
72 extra_info_name = name
73
74 for p in self.plist:
75 ei_value = p.getExtraInfo(name)
76 assert ei_value == value,\
77 f'ExtraInfo "{name}" value "{ei_value}" not what was expected "{value}"'
78
79 for p in self.comp_plist:
80 if 'multi_' in extra_info_name:
81 continue
82 ei_value = p.getDaughter(0).getExtraInfo(name)
83 assert ei_value == value,\
84 f'ExtraInfo "{name}" value "{ei_value}" not what was expected "{value}"'
85 ei_value = self.eventExtraInfo.getExtraInfo(name)
86 assert ei_value == value,\
87 f'eventExtraInfo "{name}" value "{ei_value}" not what was expected "{value}"'
88
89
90