Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit e0696b32 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update recordpubli to improve find_affiliation algorithm.

parent dcef58ba
...@@ -396,13 +396,13 @@ class RecordPubli(Record): ...@@ -396,13 +396,13 @@ class RecordPubli(Record):
""" """
df = self["authors"] df = self["authors"]
# modify the pattern to capture group query = df.affiliation.str.match(pattern)
pattern = "(%s)" % pattern data = df[query]
data = (df.affiliation.str.extract(pattern, expand=False) if data.empty:
.dropna() return ""
.unique())
data = data.affiliation.unique()
return (data[0] if len(data) > 0 else "") return (data[0] if len(data) > 0 else "")
def find_authors(self, pattern, sep=", ", sort=False): def find_authors(self, pattern, sep=", ", sort=False):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment