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
5463629b
Commit
5463629b
authored
Jan 12, 2021
by
LE GAC Renaud
Browse files
Update REcordHepPubli to fix an issue in process_publication_info
parent
896fd76d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
modules/store_tools/recordheppubli.py
modules/store_tools/recordheppubli.py
+17
-5
No files found.
modules/store_tools/recordheppubli.py
View file @
5463629b
""" store_tools.recordheppubli
"""
import
logging
from
filters
import
CLEAN_COLLABORATION
from
pandas
import
DataFrame
from
.recordhep
import
RecordHep
...
...
@@ -51,6 +53,8 @@ class RecordHepPubli(RecordHep, PluginAuthors, PluginPublicationInfo):
super
().
__init__
(
recjson
)
self
.
logger
=
logging
.
getLogger
(
"web2py.app.limbra"
)
self
.
_last_fmt_author
=
"Last, First"
self
.
_process_authors
()
self
.
_process_publication_info
()
...
...
@@ -83,6 +87,8 @@ class RecordHepPubli(RecordHep, PluginAuthors, PluginPublicationInfo):
is not defined.
"""
self
.
logger
.
debug
(
" process authors"
)
authors
=
self
.
get
(
"authors"
,
None
)
if
authors
is
None
:
...
...
@@ -159,20 +165,26 @@ class RecordHepPubli(RecordHep, PluginAuthors, PluginPublicationInfo):
and volume.
"""
self
.
logger
.
debug
(
" process publication info"
)
cols
=
[
"title"
,
"volume"
,
"year"
,
"pagination"
]
data
=
self
.
get
(
"publication_info"
,
None
)
if
data
is
None
:
cols
=
[
"title"
,
"volume"
,
"year"
,
"pagination"
]
self
.
df_info
=
DataFrame
([[
""
]
*
len
(
cols
)],
columns
=
cols
)
return
# filter data to keep only row with year information
data
=
[
dct
for
dct
in
data
if
"year"
in
dct
]
if
len
(
data
)
==
0
:
self
.
df_info
=
DataFrame
([[
""
]
*
len
(
cols
)],
columns
=
cols
)
return
# convert data to DataFrame with a well know structure
df
=
(
DataFrame
(
data
)
.
astype
({
"year"
:
str
})
...
...
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