This commit is contained in:
Carlos Gutierrez
2025-10-04 23:43:11 -04:00
parent e3663eb573
commit 878f03dd22
11 changed files with 234 additions and 18208 deletions

View File

@@ -16,6 +16,10 @@ E_MEM_PJ = 600.0
DROWSY_SCALE = 0.85
rows = []
if not os.path.exists(src):
print(f"[energy] ERROR: Source file {src} does not exist")
exit(1)
with open(src) as f:
r = csv.DictReader(f)
for row in r:
@@ -43,6 +47,10 @@ with open(src) as f:
)
rows.append(row)
if not rows:
print(f"[energy] ERROR: No data found in {src}")
exit(1)
for path in (dst_data, dst_iot):
with open(path, "w", newline="") as f:
w = csv.DictWriter(f, fieldnames=list(rows[0].keys()))