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

Update RecordPubli to add protection.

parent 0a0b3f9d
......@@ -616,7 +616,7 @@ class RecordPubli(Record):
"""
df = self["publication_info"]
return df.title.iloc[0]
return (df.title.iloc[0] if "title" in df else "")
def paper_pages(self):
"""The page number / range when the record is published in a review.
......@@ -628,7 +628,7 @@ class RecordPubli(Record):
"""
df = self["publication_info"]
return df.pagination.iloc[0]
return (df.pagination.iloc[0] if "pagination" in df else "")
def paper_reference(self):
"""The full reference for a publication published in a review.
......@@ -640,8 +640,17 @@ class RecordPubli(Record):
published in a review.
"""
paper = self["publication_info"].iloc[0]
df = self["publication_info"]
its = df.columns.intersection({"title",
"volume",
"year",
"pagination"})
if len(its) != 4:
return ""
paper = df.iloc[0]
li = [paper.title,
paper.volume,
paper.year,
......@@ -682,7 +691,7 @@ class RecordPubli(Record):
"""
df = self["publication_info"]
return df.volume.iloc[0]
return (df.volume.iloc[0] if "volume" in df else "")
def paper_year(self):
"""The year of the publication.
......@@ -693,7 +702,7 @@ class RecordPubli(Record):
"""
df = self["publication_info"]
return df.year.iloc[0]
return (df.year.iloc[0] if "year" in df else "")
def preprint_number(self):
"""The ArXiv preprint number.
......
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