Skip to content

Commit 7891684

Browse files
committed
fix: preserve existing bio when using --skip-llm
Added get_existing_bio() to check spreadsheet before generating fallback bio. Now --skip-llm will use existing bio from spreadsheet if available.
1 parent 331b8a2 commit 7891684

5 files changed

Lines changed: 29 additions & 0 deletions

File tree

data/people.xlsx

107 Bytes
Binary file not shown.

documents/JRM_CV.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,7 @@ \subsection*{Mentorship (selected)}
659659

660660
\textit{Graduate Advisees}:
661661
\begin{etaremune}
662+
\item Theo Larson (Doctoral student; 2026 -- )
662663
\item Claudia Gonciulea (Doctoral student; 2025 -- )
663664
\item Paxton Fitzpatrick (Doctoral student; 2021 -- )
664665
\item Xinming Xu (Doctoral student; 2021 -- )

images/people/theo_larson.png

207 KB
Loading

people.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ <h3>sam haskel | undergrad</h3>
192192
<h3>will lehman | undergrad</h3>
193193
<p>Will is a '27 from Salt Lake City, Utah. He likes skiing, playing hockey, and working on new projects.</p>
194194
</div>
195+
<div class="person-card">
196+
<img src="images/people/theo_larson.png" alt="theo larson">
197+
<h3>theo larson | undergrad</h3>
198+
<p>Theo is a '29 from Brooklyn, New York and a prospective major in Economics and History. In his free time, he enjoys reading, playing board games, and taking walks with his dog Sunny.</p>
199+
</div>
195200
</div>
196201
</section>
197202

scripts/onboard_member.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,23 @@ def member_exists_in_spreadsheet(
678678
return False, None
679679

680680

681+
def get_existing_bio(xlsx_path: Path, name: str) -> Optional[str]:
682+
wb = openpyxl.load_workbook(xlsx_path)
683+
sheet = wb["members"]
684+
685+
name_lower = name.lower()
686+
for row in sheet.iter_rows(min_row=2, values_only=True):
687+
if row[1] and str(row[1]).lower() == name_lower:
688+
bio = row[4] if len(row) > 4 else None
689+
wb.close()
690+
if bio and len(str(bio)) > 10:
691+
return str(bio)
692+
return None
693+
694+
wb.close()
695+
return None
696+
697+
681698
def find_alumni_entry(xlsx_path: Path, name: str) -> Optional[Dict[str, Any]]:
682699
"""Find alumni entry across all alumni sheets. Returns dict with sheet name, row, and data."""
683700
wb = openpyxl.load_workbook(xlsx_path)
@@ -1024,6 +1041,12 @@ def onboard_member(
10241041
print(" Searching git history for old bio...")
10251042
bio = get_bio_from_git_history(xlsx_path, name, project_root)
10261043

1044+
if bio is None:
1045+
existing_bio = get_existing_bio(xlsx_path, name)
1046+
if existing_bio:
1047+
print(f" Using existing bio from spreadsheet")
1048+
bio = existing_bio
1049+
10271050
if not skip_llm:
10281051
if bio:
10291052
print(" Editing bio with LLM...")

0 commit comments

Comments
 (0)