Skip to content

Commit

Permalink
TEMP: logs (#183)
Browse files Browse the repository at this point in the history
* updated for deploy

* change deploy

* logs
  • Loading branch information
aaron-wu1 authored Feb 25, 2024
1 parent 3f8fdc1 commit 3942836
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions backend/api/database/models/power_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ def get_power_data_obj(
"i": [],
"p": [],
}

print(f"start time: {start_time}, end time: {end_time}", flush=True)
stmt = (
db.select(
PowerData.ts_server.label("ts"),
PowerData.voltage.label("voltage"),
PowerData.current.label("current"),
)
.where(PowerData.cell_id == cell_id)
.where(PowerData.cell_id == cell_id)
.filter((PowerData.ts.between(start_time, end_time)))
.subquery()
)
Expand All @@ -95,11 +95,13 @@ def get_power_data_obj(
stmt.c.ts.label("ts"),
(stmt.c.voltage * 1e-3).label("voltage"),
(stmt.c.current * 1e-6).label("current"),
(stmt.c.voltage * stmt.c.current * 1e-6).label("power")
(stmt.c.voltage * stmt.c.current * 1e-6).label("power"),
).order_by(stmt.c.ts)

utc_tz = timezone.utc
la_tz = timezone(timedelta(hours=0))
res = db.session.execute(adj_units)
print(f"timestamps: {[r.ts for r in res]}", flush=True)

for row in db.session.execute(adj_units):
data["timestamp"].append(row.ts)
Expand Down

0 comments on commit 3942836

Please sign in to comment.