Spaces:
Running
Running
MilesCranmer
commited on
Prevent quotes being removed from list
Browse files- gui/app.py +11 -1
gui/app.py
CHANGED
@@ -13,6 +13,7 @@ empty_df = pd.DataFrame(
|
|
13 |
|
14 |
os.system("bash install_pysr.sh")
|
15 |
|
|
|
16 |
def greet(
|
17 |
file_obj: tempfile._TemporaryFileWrapper,
|
18 |
col_to_fit: str,
|
@@ -36,7 +37,16 @@ def greet(
|
|
36 |
"Please upload a CSV file!",
|
37 |
)
|
38 |
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
df = pd.read_csv("pysr_output.csv")
|
41 |
error_log = open("error.log", "r").read()
|
42 |
return df, error_log
|
|
|
13 |
|
14 |
os.system("bash install_pysr.sh")
|
15 |
|
16 |
+
|
17 |
def greet(
|
18 |
file_obj: tempfile._TemporaryFileWrapper,
|
19 |
col_to_fit: str,
|
|
|
37 |
"Please upload a CSV file!",
|
38 |
)
|
39 |
|
40 |
+
binary_operators = str(binary_operators).replace("'", '"')
|
41 |
+
unary_operators = str(unary_operators).replace("'", '"')
|
42 |
+
os.system(
|
43 |
+
f"python run_pysr_and_save.py "
|
44 |
+
f"--niterations {niterations} "
|
45 |
+
f"--binary_operators '{binary_operators}' "
|
46 |
+
f"--unary_operators '{unary_operators}' "
|
47 |
+
f"--col_to_fit {col_to_fit} "
|
48 |
+
f"--filename {file_obj.name}"
|
49 |
+
)
|
50 |
df = pd.read_csv("pysr_output.csv")
|
51 |
error_log = open("error.log", "r").read()
|
52 |
return df, error_log
|