Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
Example test to load data from json files stored inside the results f…
Browse files Browse the repository at this point in the history
…older
  • Loading branch information
alessiogambi committed Jun 24, 2021
1 parent 5cc0406 commit a712fb2
Show file tree
Hide file tree
Showing 2 changed files with 5,917 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/load_data_for_analysis_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import unittest
import json

from self_driving.simulation_data import SimulationDataRecord

class LoadDataFromJsonTest(unittest.TestCase):

def test_load_the_data_from_json(self):
path_json = "./results/test.0001.json"
with open(path_json, 'r') as f:
obj = json.loads(f.read())

states = [SimulationDataRecord(*r) for r in obj["execution_data"]]
print("Read ", len(states), "from file", path_json )

print("Steering: ", states[-1].steering)


if __name__ == '__main__':
unittest.main()
Loading

0 comments on commit a712fb2

Please sign in to comment.