Skip to content

Commit f7d9437

Browse files
qew21WinstonLiyt
authored andcommitted
scores.csv should not be rewritten (#653)
1 parent 11a3051 commit f7d9437

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rdagent/components/coder/data_science/workflow/eval_tests/submission_format_test.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
from pathlib import Path
22
import pandas as pd
3+
import hashlib
34

5+
def calculate_md5(file_path):
6+
with open(file_path, "rb") as f:
7+
file_hash = hashlib.md5(f.read()).hexdigest()
8+
return file_hash
9+
10+
file_md5 = calculate_md5("scores.csv")
411

512
"""
613
find . | grep -i sample | grep -i submission | grep -v sample_submission.csv | grep -v zip_files | grep -v 'sample/'
@@ -66,4 +73,5 @@ def print_first_rows(file_path, file_name, num_rows=5):
6673
print_first_rows(SAMPLE_SUBMISSION_PATH, sample_submission_name)
6774
print_first_rows('submission.csv', 'submission.csv')
6875

76+
assert calculate_md5("scores.csv") == file_md5, "scores.csv should not be rewritten"
6977
print(f"\nPlease Checked the content of the submission file(submission.csv should align with {sample_submission_name}). ")

0 commit comments

Comments
 (0)