1+ import csv
2+ import os
3+ import tempfile
14import tracemalloc
25from time import time
3- from typing import Union
46
5- from flask import Blueprint , Response , jsonify , request
6- from flask_inertia import lazy_include , render_inertia
7- import sympy as sp
87import numpy as np
8+ import sympy as sp
9+ from flask import Blueprint , request
10+ from flask_inertia import lazy_include , render_inertia
911from picos import SolutionFailure
10- import os
11- import csv
12- import tempfile
13-
12+ from sentry_sdk import capture_exception
1413from werkzeug .datastructures .file_storage import FileStorage
1514
16- import tests
1715from app .models .safety_barrier import SafetyBarrier
1816from app .models .stability import Stability
1917
2018bp = Blueprint ("dashboard" , __name__ )
2119
20+
2221def calculate_result () -> dict :
2322 """
2423 Calculate the result of the user's input.
@@ -50,6 +49,7 @@ def calculate_result() -> dict:
5049 "error" : "An unknown error occurred." ,
5150 "description" : str (e ),
5251 }
52+ capture_exception (e )
5353
5454 time_taken = time () - start_time
5555
@@ -138,6 +138,7 @@ def index():
138138 },
139139 )
140140
141+
141142def _parse_uploaded_files (data : dict ) -> dict :
142143 """
143144 Parse the uploaded files and add them to the data dictionary.
@@ -173,6 +174,7 @@ def _parse_uploaded_files(data: dict) -> dict:
173174
174175 return data
175176
177+
176178def __load_mosek_license (_file : FileStorage ) -> bool :
177179 """
178180 Read the MOSEK licence file into this request.
@@ -186,4 +188,4 @@ def __load_mosek_license(_file: FileStorage) -> bool:
186188
187189 temp .close ()
188190
189- return True
191+ return True
0 commit comments