Skip to content

Commit

Permalink
auto add params.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
ruidonghan committed Sep 14, 2022
1 parent a0527f9 commit 67597b7
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions 4.validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,19 @@
results.append(result)
else:
if not os.path.exists(f'result/params.csv'):
while not os.access(f"result/params.csv", os.W_OK):
continue
data = pd.DataFrame(columns=(toolConfig.PARAM + ['score', 'result']))
else:
while not os.access(f"result/params.csv", os.W_OK):
continue
# Add instability resutl
tmp_row = value_vector.tolist()
tmp_row.append(vars[0])
tmp_row.append(result)

# Write Row
with open("result/params.csv", 'a+') as f:
csv_file = csv.writer(f)
csv_file.writerow(tmp_row)
data.to_csv(f'result/params.csv', index=False)
while not os.access(f"result/params.csv", os.W_OK):
continue
# Add instability resutl
tmp_row = value_vector.tolist()
tmp_row.append(vars[0])
tmp_row.append(result)

# Write Row
with open("result/params.csv", 'a+') as f:
csv_file = csv.writer(f)
csv_file.writerow(tmp_row)

manager.stop_sitl()
i += 1
Expand Down

0 comments on commit 67597b7

Please sign in to comment.