Spaces:
Running
Running
style(gui): ruff lint
Browse files- gui/processing.py +10 -8
gui/processing.py
CHANGED
|
@@ -10,13 +10,15 @@ import pandas as pd
|
|
| 10 |
from data import generate_data, read_csv
|
| 11 |
from plots import plot_predictions
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
|
| 21 |
|
| 22 |
def pysr_fit(queue: mp.Queue, out_queue: mp.Queue):
|
|
@@ -138,7 +140,7 @@ def processing(
|
|
| 138 |
try:
|
| 139 |
X, y = read_csv(file_input, force_run)
|
| 140 |
except ValueError as e:
|
| 141 |
-
return (
|
| 142 |
else:
|
| 143 |
X, y = generate_data(test_equation, num_points, noise_level, data_seed)
|
| 144 |
|
|
|
|
| 10 |
from data import generate_data, read_csv
|
| 11 |
from plots import plot_predictions
|
| 12 |
|
| 13 |
+
|
| 14 |
+
def empty_df():
|
| 15 |
+
return pd.DataFrame(
|
| 16 |
+
{
|
| 17 |
+
"Equation": [],
|
| 18 |
+
"Loss": [],
|
| 19 |
+
"Complexity": [],
|
| 20 |
+
}
|
| 21 |
+
)
|
| 22 |
|
| 23 |
|
| 24 |
def pysr_fit(queue: mp.Queue, out_queue: mp.Queue):
|
|
|
|
| 140 |
try:
|
| 141 |
X, y = read_csv(file_input, force_run)
|
| 142 |
except ValueError as e:
|
| 143 |
+
return (empty_df(), plot_predictions([], []), str(e))
|
| 144 |
else:
|
| 145 |
X, y = generate_data(test_equation, num_points, noise_level, data_seed)
|
| 146 |
|