Skip to content

Commit

Permalink
Adding Dijkstra download
Browse files Browse the repository at this point in the history
  • Loading branch information
thdfw committed Dec 20, 2024
1 parent 391955e commit 2967cd8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from sqlalchemy.orm import sessionmaker
from fake_config import Settings
from fake_models import MessageSql
import os

def download_excel(house_alias, start_ms):
settings = Settings(_env_file=dotenv.find_dotenv())
Expand All @@ -32,6 +33,8 @@ def download_excel(house_alias, start_ms):
# for key, value in flo_params_msg.payload.items():
# print(f'{key}: {value}')

os.remove('result.xlsx')

print("Running Dijkstra and saving analysis to excel...")
g = DGraph(flo_params)
g.solve_dijkstra()
Expand Down
7 changes: 4 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
const endUnixMilliseconds = endtime_luxon.toUTC().toMillis();

try {
const response = await fetch('http://localhost:8000/download_excel', {
const response = await fetch(`https://visualizer.electricity.works/download_excel`, {
// const response = await fetch('http://localhost:8000/download_excel', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand Down Expand Up @@ -151,8 +152,8 @@
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;

try {
//const response = await fetch(`https://visualizer.electricity.works/plots`, {
const response = await fetch(`http://localhost:8000/plots`, {
const response = await fetch(`https://visualizer.electricity.works/plots`, {
// const response = await fetch(`http://localhost:8000/plots`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
Expand Down

0 comments on commit 2967cd8

Please sign in to comment.