JovsB commited on
Commit
8ef9fac
·
verified ·
1 Parent(s): 395343b

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -0
main.py CHANGED
@@ -95,6 +95,7 @@ def solve_function(data: SolverInput):
95
  "y": y_vals.tolist()
96
  }
97
 
 
98
  # Prepare the response
99
  response_data = {
100
  "x_min": result['x_min'],
@@ -103,6 +104,8 @@ def solve_function(data: SolverInput):
103
  "num_iterations": result['num_iterations'],
104
  "plot_data": plot_data
105
  }
 
 
106
 
107
  # Add to session history
108
  history_entry = {**response_data, "function": data.func_str, "bounds": {"a": data.a, "b": data.b}, "mode": data.mode, "tolerance": data.tol}
 
95
  "y": y_vals.tolist()
96
  }
97
 
98
+
99
  # Prepare the response
100
  response_data = {
101
  "x_min": result['x_min'],
 
104
  "num_iterations": result['num_iterations'],
105
  "plot_data": plot_data
106
  }
107
+ if 'warning' in result:
108
+ response_data['warning'] = result['warning']
109
 
110
  # Add to session history
111
  history_entry = {**response_data, "function": data.func_str, "bounds": {"a": data.a, "b": data.b}, "mode": data.mode, "tolerance": data.tol}