Check that the given CSV row is a valid header for a statsfile. Arguments: row: A row decoded from the CSV reader. Returns: True if `row` is a valid statsfile header, False otherwise.
(row: list[str])
| 204 | |
| 205 | @staticmethod |
| 206 | def valid_header(row: list[str]) -> bool: |
| 207 | """Check that the given CSV row is a valid header for a statsfile. |
| 208 | |
| 209 | Arguments: |
| 210 | row: A row decoded from the CSV reader. |
| 211 | |
| 212 | Returns: |
| 213 | True if `row` is a valid statsfile header, False otherwise. |
| 214 | """ |
| 215 | if not row or not len(row) >= 2: |
| 216 | return False |
| 217 | return not (row[0] != COLUMN_NAME_FRAME_NUMBER or row[1] != COLUMN_NAME_TIMECODE) |
| 218 | |
| 219 | # TODO(v1.0): Create a replacement for a calculation cache that functions like load_from_csv |
| 220 | # did, but is better integrated with detectors for cached calculations instead of statistics. |