Skip to content
Snippets Groups Projects
DataChecker.py 733 B
Newer Older
  • Learn to ignore specific revisions
  • Lennard Geese's avatar
    T
    Lennard Geese committed
    from DataHandler import DataHandler
    
    
    class DataChecker(DataHandler):
    
        def check_imported_race(self, race_data):
            for current_lap in range(len(race_data)):
                print(f"Lap {current_lap}")
                for position in range(1, len(race_data[0]) + 1):
                    driver_at_position = race_data[current_lap][position - 1]
                    if driver_at_position == self.invalidDriverId:
                        break  # skip entries without drivers
                    print(f"P{position}: {race_data[current_lap][position - 1]}")
                print()
            print(f"Number of laps run: {len(race_data) - 1}")
    
        def check_imported_races(self, races):
            for race in races:
                self.check_imported_race(race)