| 163 | |
| 164 | @property |
| 165 | def time(self) -> str: |
| 166 | all_results = [*self.model_results.values(), *self.additional_results.values()] |
| 167 | time_spent = [r["time_spent"].split(", ")[0] for r in all_results if len(r["time_spent"])] |
| 168 | total_secs = 0 |
| 169 | |
| 170 | for time in time_spent: |
| 171 | time_parts = time.split(":") |
| 172 | |
| 173 | # Time can be formatted as xx:xx:xx, as .xx, or as x.xx if the time spent was less than a minute. |
| 174 | if len(time_parts) == 1: |
| 175 | time_parts = [0, 0, time_parts[0]] |
| 176 | |
| 177 | hours, minutes, seconds = int(time_parts[0]), int(time_parts[1]), float(time_parts[2]) |
| 178 | total_secs += hours * 3600 + minutes * 60 + seconds |
| 179 | |
| 180 | hours, minutes, seconds = total_secs // 3600, (total_secs % 3600) // 60, total_secs % 60 |
| 181 | return f"{int(hours)}h{int(minutes)}m{int(seconds)}s" |
| 182 | |
| 183 | @property |
| 184 | def header(self) -> Dict: |