Skip to content

Commit

Permalink
rescaled axis
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-wu1 committed Jul 28, 2023
1 parent 7c70284 commit cd6033a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions backend/api/database/models/power_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def get_power_data(cell_id, resample="hour"):

adj_units = db.select(
resampled.c.ts.label("ts"),
(resampled.c.voltage * 10e3).label("voltage"),
(resampled.c.current * 10e6).label("current"),
(resampled.c.voltage * 1e3).label("voltage"),
(resampled.c.current * 1e6).label("current"),
).subquery()

stmt = db.select(
Expand Down Expand Up @@ -107,9 +107,9 @@ def get_power_data_obj(cell_id, resample="hour"):

stmt = db.select(
adj_units.c.ts.label("ts"),
(adj_units.c.voltage * 10e3).label("voltage"),
(adj_units.c.current * 10e6).label("current"),
(adj_units.c.voltage * adj_units.c.current * 10e6).label("power"),
(adj_units.c.voltage * 1e3).label("voltage"),
(adj_units.c.current * 1e6).label("current"),
(adj_units.c.voltage * adj_units.c.current * 1e6).label("power"),
).order_by(adj_units.c.ts)

for row in db.session.execute(stmt):
Expand Down

0 comments on commit cd6033a

Please sign in to comment.