Skip to content

Commit

Permalink
Fix bug in bibtex_to_table.py for repeated entries
Browse files Browse the repository at this point in the history
  • Loading branch information
XuhuiZhou committed Apr 12, 2024
1 parent 13af21b commit a6dc552
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bibtex_to_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def bibtex_to_table(bibtex: str, taxonomy: dict[str, list[str]]) -> str:
# check if there are repeated entries and give exact repeated entries
ids = [entry["title"] for entry in entries]
if len(ids) != len(set(ids)):
repeated_entries = [entry for entry in entries if ids.count(entry["title"]) > 1]
repeated_entries = [entry['title'] for entry in entries if ids.count(entry["title"]) > 1]
raise ValueError(f"Repeated entries found: {repeated_entries}")
# Create a Markdown table
headers = ["Title", "Date"] + list(taxonomy.keys()) + ["helper"]
Expand Down

0 comments on commit a6dc552

Please sign in to comment.