Skip to content

Commit 4515630

Browse files
committed
Add method to count first author publications
1 parent bf00ace commit 4515630

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/cvprocessor/publications.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,16 @@ def get_num_publications_by_author(self, author_id):
450450
count += 1
451451
return count
452452

453+
def get_first_author_num_publications(self, author_id):
454+
"""
455+
Gets the number of publications where the author is the first author.
456+
"""
457+
count = 0
458+
for publication in self:
459+
if publication.get_auth_id_aff_id()[0].get_author_id() == author_id:
460+
count += 1
461+
return count
462+
453463
def get_publications_date_range(self):
454464
"""
455465
Gets the date range of the publications.

0 commit comments

Comments
 (0)