Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
46ce389
1
Parent(s):
2b287f1
Clean up Feynman problems
Browse files- pysr/feynman_problems.py +3 -9
pysr/feynman_problems.py
CHANGED
@@ -80,20 +80,14 @@ def mk_problems(first=100, gen=False, dp=500, data_dir=FEYNMAN_DATASET):
|
|
80 |
"""
|
81 |
ret = []
|
82 |
with open(data_dir) as csvfile:
|
83 |
-
ind = 0
|
84 |
reader = csv.DictReader(csvfile)
|
85 |
for i, row in enumerate(reader):
|
86 |
-
if
|
87 |
break
|
88 |
if row["Filename"] == "":
|
89 |
continue
|
90 |
-
|
91 |
-
|
92 |
-
ret.append(p)
|
93 |
-
except Exception as e:
|
94 |
-
traceback.print_exc()
|
95 |
-
print(f"FAILED ON ROW {i} with {e}")
|
96 |
-
ind += 1
|
97 |
return ret
|
98 |
|
99 |
|
|
|
80 |
"""
|
81 |
ret = []
|
82 |
with open(data_dir) as csvfile:
|
|
|
83 |
reader = csv.DictReader(csvfile)
|
84 |
for i, row in enumerate(reader):
|
85 |
+
if i > first:
|
86 |
break
|
87 |
if row["Filename"] == "":
|
88 |
continue
|
89 |
+
p = FeynmanProblem(row, gen=gen, dp=dp)
|
90 |
+
ret.append(p)
|
|
|
|
|
|
|
|
|
|
|
91 |
return ret
|
92 |
|
93 |
|