Skip to content

Commit 3b1d68f

Browse files
committed
Allow adding affiliation & research directions
1 parent e9bdfa2 commit 3b1d68f

File tree

6 files changed

+56
-1
lines changed

6 files changed

+56
-1
lines changed

_data/authors.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,3 +596,28 @@ Hao Yu:
596596
url: https://scholar.google.com/citations?user=5Z10ts4AAAAJ&hl=zh-CN
597597
- label: LinkedIn
598598
url: https://www.linkedin.com/in/haoy/
599+
600+
Jean-Francois Godbout:
601+
name: Jean-François Godbout
602+
avatar: /assets/images/bio/jean-francois-godbout.png
603+
bio:
604+
note:
605+
semantic_scholar_id: "2490772"
606+
auto_update_publications: true
607+
current_role:
608+
type: Collaborator
609+
title: Professor
610+
affiliation: Mila, University of Montreal
611+
research_directions:
612+
- poli-sci
613+
social_media_links:
614+
- label: Website
615+
url: https://jf-godbout.github.io/
616+
- label: Twitter
617+
url: https://x.com/JF_Godbout
618+
- label: GitHub
619+
url: https://github.com/jf-godbout
620+
- label: Scholar
621+
url: https://scholar.google.com/citations?user=SsVx064AAAAJ&hl=en
622+
- label: LinkedIn
623+
url: https://www.linkedin.com/in/jean-fran%C3%A7ois-godbout-9aa130221
217 KB
Loading

src/python/add_update_member.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ def process_role_data(parsed: Dict, prefix: str = "") -> Optional[Dict]:
4848
if value and value != "_No response_":
4949
role[field] = value
5050

51+
# Add new fields for affiliation and research directions
52+
affiliation = parsed.get(f"{prefix}affiliation")
53+
if affiliation and affiliation != "_No response_":
54+
role["affiliation"] = affiliation
55+
56+
research_directions = parsed.get(f"{prefix}research-directions")
57+
if research_directions and research_directions != "_No response_":
58+
# Handle both string and list inputs for research directions
59+
if isinstance(research_directions, str):
60+
# Split by commas if it's a comma-separated string
61+
directions = [d.strip() for d in research_directions.split(',')]
62+
else:
63+
directions = research_directions
64+
role["research_directions"] = directions
65+
5166
return role
5267

5368

tests/data/add_member/in.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ Student
3030

3131
PhD
3232

33+
### Current_role-affiliation
34+
35+
Mila, McGill
36+
37+
### Current_role-research-directions
38+
39+
online-toxicity, temporal-graph-learning
40+
41+
3342
### Current_role-advisor
3443

3544
Reihaneh Rabbany

tests/data/add_member/out.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
"current_role": {
66
"type": "Student",
77
"title": "PhD",
8+
"affiliation": "Mila, McGill",
9+
"research_directions": [
10+
"online-toxicity",
11+
"temporal-graph-learning"
12+
],
813
"advisor": "Reihaneh Rabbany",
914
"start_date": "Fall 2019"
1015
},

tests/test_add_update_member.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ def tearDownClass(cls) -> None:
3434
if os.path.exists(path):
3535
shutil.rmtree(path)
3636

37-
def test_add_member(self):
37+
def test_add_member(self):
3838
with open("tests/data/add_member/in.md") as f:
3939
issue_body = f.read()
4040

4141
parsed = mod.parse_issue_body(issue_body)
4242
out = mod.main(parsed, action="Add member", image_dir=self.image_dir, site_data_dir=self.site_data_dir)
43+
4344
with open("tests/data/add_member/out.json") as f:
4445
expected = json.load(f)
4546

0 commit comments

Comments
 (0)