Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
9a46c88
1
Parent(s):
05cff8a
Fix potential bug with user equation filename in temp dir
Browse files- pysr/sr.py +5 -6
pysr/sr.py
CHANGED
@@ -281,12 +281,11 @@ def pysr(X=None, y=None, weights=None,
|
|
281 |
|
282 |
kwargs = {**_set_paths(tempdir), **kwargs}
|
283 |
|
284 |
-
if
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
equation_file = 'hall_of_fame_' + date_time + '.csv'
|
290 |
|
291 |
kwargs = {**dict(equation_file=equation_file), **kwargs}
|
292 |
|
|
|
281 |
|
282 |
kwargs = {**_set_paths(tempdir), **kwargs}
|
283 |
|
284 |
+
if temp_equation_file:
|
285 |
+
equation_file = kwargs['tmpdir'] / f'hall_of_fame.csv'
|
286 |
+
elif equation_file is None:
|
287 |
+
date_time = datetime.now().strftime("%Y-%m-%d_%H%M%S.%f")[:-3]
|
288 |
+
equation_file = 'hall_of_fame_' + date_time + '.csv'
|
|
|
289 |
|
290 |
kwargs = {**dict(equation_file=equation_file), **kwargs}
|
291 |
|