improved eval_records

This commit is contained in:
2024-10-18 22:47:32 +02:00
parent ffd1451024
commit 5e0c256720
+10 -2
View File
@@ -111,16 +111,24 @@ for day in day_list:
for filename in file_list:
file_path = os.path.join(day_path, filename)
print(f"Open file: {filename}")
with open(file_path, "r") as fp:
records = json.load(fp)
print(f"Found {len(records)} records")
for record in records:
try:
vehicle_data = record['data']
if record['info']['is_delta']:
record = deep_merge(last, record['data'])
print(f"Found delta record {record['info']['record_id']}")
vehicle_data = deep_merge(last, record['data'])
record['data'] = vehicle_data
else:
print(f"Found full record {record['info']['record_id']}")
except KeyError:
pass
last = record
last = vehicle_data
try:
for end_point in end_points:
end_point.assign(record)