Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
limbra
limbra
Commits
9ad6058d
Commit
9ad6058d
authored
Jan 07, 2021
by
LE GAC Renaud
Browse files
Update PluginPublicationInfo to standardize journal editor
parent
64623f9c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
modules/store_tools/pluginpublicationinfo.py
modules/store_tools/pluginpublicationinfo.py
+10
-3
No files found.
modules/store_tools/pluginpublicationinfo.py
View file @
9ad6058d
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
"""
"""
import
numpy
as
np
import
numpy
as
np
import
re
PAPER_REFERENCE_KEYS
=
{
"pagination"
,
"title"
,
"volume"
,
"year"
}
PAPER_REFERENCE_KEYS
=
{
"pagination"
,
"title"
,
"volume"
,
"year"
}
...
@@ -63,7 +64,7 @@ class PluginPublicationInfo(object):
...
@@ -63,7 +64,7 @@ class PluginPublicationInfo(object):
return
len
(
df
)
>
1
return
len
(
df
)
>
1
def
paper_editor
(
self
):
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:
Returns:
str:
str:
...
@@ -71,7 +72,12 @@ class PluginPublicationInfo(object):
...
@@ -71,7 +72,12 @@ class PluginPublicationInfo(object):
"""
"""
df
=
self
[
"publication_info"
]
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
):
def
paper_pages
(
self
):
"""The page number / range when the record is published in a review.
"""The page number / range when the record is published in a review.
...
@@ -105,8 +111,9 @@ class PluginPublicationInfo(object):
...
@@ -105,8 +111,9 @@ class PluginPublicationInfo(object):
if
len
(
its
)
!=
4
:
if
len
(
its
)
!=
4
:
return
""
return
""
# add space after the dot Phys.Rev -> Phys. Rev
paper
=
df
.
iloc
[
0
]
paper
=
df
.
iloc
[
0
]
li
=
[
paper
.
title
,
li
=
[
re
.
sub
(
r
'\.([A-Z])'
,
r
'. \1'
,
paper
.
title
)
,
paper
.
volume
,
paper
.
volume
,
paper
.
year
,
paper
.
year
,
paper
.
pagination
]
paper
.
pagination
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment