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
8e4dbfc0
Commit
8e4dbfc0
authored
Jan 15, 2021
by
LE GAC Renaud
Browse files
Improve debug message in RecordCds, RecordHepPubli and friends
parent
378867e0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
modules/store_tools/recordcdspubli.py
modules/store_tools/recordcdspubli.py
+5
-1
modules/store_tools/recordhepconfpaper.py
modules/store_tools/recordhepconfpaper.py
+17
-1
modules/store_tools/recordheppubli.py
modules/store_tools/recordheppubli.py
+3
-3
No files found.
modules/store_tools/recordcdspubli.py
View file @
8e4dbfc0
...
...
@@ -15,7 +15,7 @@ from .base import (ARXIV,
search_synonym
,
REG_DOI
,
REG_OAI
,
T6
)
T4
,
T6
)
from
.exception
import
CheckException
from
filters
import
CLEAN_COLLABORATION
from
pandas
import
concat
,
DataFrame
...
...
@@ -238,6 +238,8 @@ class RecordCdsPubli(dict, AuthorsMixin, PublicationInfoMixin):
field does not exist.
"""
self
.
logger
.
debug
(
f
"
{
T4
}
process authors"
)
if
"authors"
not
in
self
:
cols
=
[
"affiliation"
,
"first_name"
,
...
...
@@ -313,6 +315,8 @@ class RecordCdsPubli(dict, AuthorsMixin, PublicationInfoMixin):
and volume.
"""
self
.
logger
.
debug
(
f
"
{
T4
}
process publication info"
)
if
"publication_info"
not
in
self
:
cols
=
[
"title"
,
"volume"
,
...
...
modules/store_tools/recordhepconfpaper.py
View file @
8e4dbfc0
...
...
@@ -3,6 +3,7 @@
"""
import
requests
from
.base
import
T4
,
T6
from
datetime
import
datetime
from
plugin_dbui
import
CLEAN_SPACES
from
.recordheppubli
import
RecordHepPubli
...
...
@@ -20,6 +21,15 @@ class RecordHepConfPaper(RecordHepPubli):
Schema for conference metadata is document here:
https://inspire-schemas.readthedocs.io/en/latest/schemas/
Main information are:
* addresses: [{cities: [], country: str, ...}, ...]
* cnum: str
* control_number: int
* closing_date: str
* opening_date: str
* titles: [{value: str}, ...]
* urls: [{value: str}, ...]
"""
def
__init__
(
self
,
recjson
):
...
...
@@ -30,12 +40,16 @@ class RecordHepConfPaper(RecordHepPubli):
self
.
_process_conference_data
()
def
_process_conference_data
(
self
):
"""Append the conference record.
"""Append the conference
data to the
record.
"""
logger
=
self
.
logger
logger
.
debug
(
f
"
{
T4
}
process conference data"
)
# get the URL of the conference record in inspirehep.net
publication_info
=
self
.
get
(
"publication_info"
,
None
)
if
publication_info
is
None
:
logger
.
debug
(
f
"
{
T6
}
no 'publication_info' field"
)
return
urlins
=
None
...
...
@@ -44,6 +58,7 @@ class RecordHepConfPaper(RecordHepPubli):
urlins
=
elt
.
get
(
"conference_record"
,
{}).
get
(
"$ref"
,
None
)
if
urlins
is
None
:
logger
.
debug
(
f
"
{
T6
}
no 'conference_record.$ref' information"
)
return
# get conference metadata
...
...
@@ -53,6 +68,7 @@ class RecordHepConfPaper(RecordHepPubli):
obj
=
r
.
json
()
except
(
requests
.
RequestException
,
ValueError
):
logger
.
debug
(
f
"
{
T6
}
failed to retrieve conference data"
)
return
self
.
conference
=
obj
.
get
(
"metadata"
,
None
)
...
...
modules/store_tools/recordheppubli.py
View file @
8e4dbfc0
...
...
@@ -9,7 +9,7 @@ from .base import (search_synonym,
MSG_UNKNOWN_COLLABORATION
,
MSG_WELL_FORMED_DATE
,
REG_DATE_YYYYMM
,
T6
)
T4
,
T6
)
from
.exception
import
CheckException
from
filters
import
CLEAN_COLLABORATION
from
pandas
import
DataFrame
...
...
@@ -98,7 +98,7 @@ class RecordHepPubli(dict, AuthorsMixin, PublicationInfoMixin):
is not defined.
"""
self
.
logger
.
debug
(
"
process authors"
)
self
.
logger
.
debug
(
f
"
{
T4
}
process authors"
)
authors
=
self
.
get
(
"authors"
,
None
)
...
...
@@ -176,7 +176,7 @@ class RecordHepPubli(dict, AuthorsMixin, PublicationInfoMixin):
and volume.
"""
self
.
logger
.
debug
(
"
process publication info"
)
self
.
logger
.
debug
(
f
"
{
T4
}
process publication info"
)
cols
=
[
"title"
,
"volume"
,
...
...
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