Skip to content

Commit

Permalink
reverted temp (#186)
Browse files Browse the repository at this point in the history
* reverted temp

* lint backend
  • Loading branch information
aaron-wu1 authored Feb 25, 2024
1 parent 619aaf1 commit 0e5735a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ RUN chown -R app:app $APP_HOME
# change to the app user
USER app
WORKDIR /home/app/
ENTRYPOINT ["./backend/entrypoint.sh", "-d"]
ENTRYPOINT ["./backend/entrypoint.sh", "-p"]
1 change: 0 additions & 1 deletion backend/api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class Config(object):
SQLALCHEMY_DATABASE_URI = dburl
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ENGINE_OPTIONS = {"pool_pre_ping": True}
SQLALCHEMY_ECHO = True
GOOGLE_CLIENT_ID = os.getenv("GOOGLE_CLIENT_ID")
GOOGLE_CLIENT_SECRET = os.getenv("GOOGLE_CLIENT_SECRET")
REDIRECT_URI = os.getenv("OAUTH_REDIRECT_URI")
Expand Down
9 changes: 2 additions & 7 deletions backend/api/database/models/power_data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ..models import db
from .cell import Cell
from .logger import Logger
from datetime import datetime, timezone, timedelta
from datetime import datetime
from dateutil.relativedelta import relativedelta


Expand Down Expand Up @@ -78,7 +78,7 @@ 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"),
Expand All @@ -98,11 +98,6 @@ def get_power_data_obj(
(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)
data["v"].append(row.voltage)
Expand Down
5 changes: 1 addition & 4 deletions backend/api/database/models/teros_data.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from ..models import db
from sqlalchemy.sql import func
from .cell import Cell
from datetime import datetime, timezone, timedelta
from datetime import datetime
from dateutil.relativedelta import relativedelta


Expand Down Expand Up @@ -86,9 +86,6 @@ def get_teros_data_obj(
.order_by(TEROSData.ts_server)
)

utc_tz = timezone.utc
la_tz = timezone(timedelta(hours=0))

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

0 comments on commit 0e5735a

Please sign in to comment.