Load a reference result set from a CSV file on disk. Args: file_path: The input file path.
(self, file_path: Path)
| 242 | writer.writerow(row) |
| 243 | |
| 244 | def load_from_file(self, file_path: Path) -> None: |
| 245 | ''' |
| 246 | Load a reference result set from a CSV file on disk. |
| 247 | |
| 248 | Args: |
| 249 | file_path: The input file path. |
| 250 | ''' |
| 251 | with open(file_path, 'r', encoding='utf-8') as handle: |
| 252 | reader = csv.reader(handle) |
| 253 | |
| 254 | # Skip the header |
| 255 | next(reader) |
| 256 | |
| 257 | # Read the data rows |
| 258 | for row in reader: |
| 259 | assert row[0] == self.test_set_name |
| 260 | |
| 261 | record = Record( |
| 262 | row[1], |
| 263 | row[2], |
| 264 | float(row[3]), |
| 265 | float(row[4]), |
| 266 | float(row[5]), |
| 267 | float(row[6]) |
| 268 | ) |
| 269 | |
| 270 | self.add_record(record) |
| 271 | |
| 272 | |
| 273 | class ResultSummary: |