Skip to content

Commit

Permalink
Merge branch 'colav:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
omazapa authored Nov 17, 2024
2 parents db9a500 + 533be4f commit a8491b3
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def merge_documents(self, authors_docs, target_doc):
other_docs = []
for doc in authors_docs:
if doc['_id'] != target_id:
if not compare_author(target_doc, doc):
if not compare_author(target_doc, doc, len(authors_docs)):
continue
# updated
target_update_sources = {profile["source"]
Expand Down Expand Up @@ -271,6 +271,9 @@ def doi_unicity(self, reg, jobs, verbose=0):
"""
# Fetch author documents from the database
author_ids = reg["authors"]
# Store the number of authors
n_authors = len(author_ids)
# Fetch the author documents from the database
author_docs = self.collection.find({"_id": {"$in": author_ids}}, {
"first_names": 1, "last_names": 1, "full_name": 1, "updated": 1, "external_ids": 1, "initials": 1})

Expand All @@ -296,7 +299,7 @@ def doi_unicity(self, reg, jobs, verbose=0):
if author["_id"] == other_author["_id"]:
continue
# Perform the author comparison
if compare_author(author, other_author):
if compare_author(author, other_author, n_authors):
if not found:
found.append(set([author["_id"], other_author["_id"]]))
else:
Expand Down

0 comments on commit a8491b3

Please sign in to comment.