Spaces:
Sleeping
Sleeping
Fix error with not printing to error log
Browse files- gui/run_pysr_and_save.py +6 -4
gui/run_pysr_and_save.py
CHANGED
|
@@ -58,11 +58,13 @@ if __name__ == "__main__":
|
|
| 58 |
df = model.equations_[["equation", "loss", "complexity"]]
|
| 59 |
# Convert all columns to string type:
|
| 60 |
df = df.astype(str)
|
| 61 |
-
|
| 62 |
except Exception as e:
|
| 63 |
error_message = tb.format_exc()
|
| 64 |
# Dump to file:
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
| 68 |
|
|
|
|
| 58 |
df = model.equations_[["equation", "loss", "complexity"]]
|
| 59 |
# Convert all columns to string type:
|
| 60 |
df = df.astype(str)
|
| 61 |
+
error_message = "Success!"
|
| 62 |
except Exception as e:
|
| 63 |
error_message = tb.format_exc()
|
| 64 |
# Dump to file:
|
| 65 |
+
df = empty_df
|
| 66 |
+
|
| 67 |
+
df.to_csv("pysr_output.csv", index=False)
|
| 68 |
+
with open("error.log", "w") as f:
|
| 69 |
+
f.write(error_message)
|
| 70 |
|