Commit 9ad6058d authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update PluginPublicationInfo to standardize journal editor

parent 64623f9c
......@@ -2,6 +2,7 @@
"""
import numpy as np
import re
PAPER_REFERENCE_KEYS = {"pagination", "title", "volume", "year"}
......@@ -63,7 +64,7 @@ class PluginPublicationInfo(object):
return len(df) > 1
def paper_editor(self):
"""The abbreviated version of the review, *e.g* Phys Lett B.
"""The abbreviated version of the review, *e.g* Phys. Lett. B.
Returns:
str:
......@@ -71,7 +72,12 @@ class PluginPublicationInfo(object):
"""
df = self["publication_info"]
return (df.title.iloc[0] if "title" in df else "")
editor = (df.title.iloc[0] if "title" in df else "")
# add space after the dot Phys.Rev -> Phys. Rev
editor = re.sub(r'\.([A-Z])', r'. \1', editor)
return editor
def paper_pages(self):
"""The page number / range when the record is published in a review.
......@@ -105,8 +111,9 @@ class PluginPublicationInfo(object):
if len(its) != 4:
return ""
# add space after the dot Phys.Rev -> Phys. Rev
paper = df.iloc[0]
li = [paper.title,
li = [re.sub(r'\.([A-Z])', r'. \1', paper.title),
paper.volume,
paper.year,
paper.pagination]
......
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