Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaiyu Yang committed Apr 14, 2024
1 parent 285665c commit 0b75b48
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions prover/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,17 @@ def _get_theorems_from_files(
repo = LeanGitRepo(t["url"], t["commit"])
theorems.append(Theorem(repo, t["file_path"], t["full_name"]))
positions.append(Pos(*t["start"]))
# jointly sort theorems and positions

# Jointly sort theorems and positions
theorems_and_positions = list(zip(theorems, positions))
theorems_and_positions.sort(key=lambda x: hashlib.md5(f"{x[0].file_path}:{x[0].full_name}".encode()).hexdigest())
theorems_and_positions.sort(
key=lambda x: hashlib.md5(
f"{x[0].file_path}:{x[0].full_name}".encode()
).hexdigest()
)
theorems, positions = zip(*theorems_and_positions)
theorems, positions = list(theorems), list(positions)

if num_theorems is not None:
theorems = theorems[:num_theorems]
positions = positions[:num_theorems]
Expand Down

0 comments on commit 0b75b48

Please sign in to comment.