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
e4ed5623
Commit
e4ed5623
authored
Jan 18, 2021
by
LE GAC Renaud
Browse files
Remove method check_paper_reference in RecordCdsPubli and RecordHepPubli
parent
2297f17a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
0 additions
and
79 deletions
+0
-79
controllers/harvest.py
controllers/harvest.py
+0
-1
modules/harvest_tools/articles.py
modules/harvest_tools/articles.py
+0
-1
modules/harvest_tools/proceedings.py
modules/harvest_tools/proceedings.py
+0
-1
modules/store_tools/recordcdspubli.py
modules/store_tools/recordcdspubli.py
+0
-61
modules/store_tools/recordheppubli.py
modules/store_tools/recordheppubli.py
+0
-5
tests/basis/test_13_check_and_fix_article_cds.py
tests/basis/test_13_check_and_fix_article_cds.py
+0
-2
tests/basis/test_14_check_fix_article_ins.py
tests/basis/test_14_check_fix_article_ins.py
+0
-3
tests/basis/test_15_check_and_fix_proceeding_cds.py
tests/basis/test_15_check_and_fix_proceeding_cds.py
+0
-2
tests/basis/test_16_check_and_fix_proceeding_ins.py
tests/basis/test_16_check_and_fix_proceeding_ins.py
+0
-3
No files found.
controllers/harvest.py
View file @
e4ed5623
...
...
@@ -240,7 +240,6 @@ def edit_insert():
try
:
record
.
format_editor
()
record
.
check_paper_reference
()
recId
=
UNDEF_ID
recId
=
search_synonym
(
db
.
publishers
,
...
...
modules/harvest_tools/articles.py
View file @
e4ed5623
...
...
@@ -73,7 +73,6 @@ class Articles(Automaton):
record
.
format_editor
()
record
.
check_publisher
(
self
.
db
)
record
.
check_paper_reference
()
except
CheckException
as
e
:
self
.
logs
[
-
1
].
reject
(
e
,
record
=
record
)
...
...
modules/harvest_tools/proceedings.py
View file @
e4ed5623
...
...
@@ -61,7 +61,6 @@ class Proceedings(Automaton):
record
.
check_conference_date
()
record
.
format_editor
()
record
.
check_publisher
(
self
.
db
)
record
.
check_paper_reference
()
except
CheckException
as
e
:
self
.
logs
[
-
1
].
reject
(
e
,
record
=
record
)
...
...
modules/store_tools/recordcdspubli.py
View file @
e4ed5623
...
...
@@ -442,67 +442,6 @@ class RecordCdsPubli(dict, AuthorsMixin, PublicationInfoMixin):
if
len
(
value
)
==
0
:
raise
CheckException
(
MSG_NO_MY_AUTHOR
)
def
check_paper_reference
(
self
):
"""Check that editor, page, volume and paper year are defined
for a published paper. Repair it from doi when possible.
Args:
record (RecordCdsPubli):
record describing a publication.
Raises:
CheckException:
the paper reference is not well formed.
"""
self
.
logger
.
debug
(
f
"
{
T6
}
check paper reference"
)
if
self
.
is_published
():
return
# paper reference can be incomplete or missing
# is the paper published ? In that case the doi is defined
if
"doi"
not
in
self
:
return
# what information is missing ?
# * df.columns are title, volume, year and pagination
# * df can contains one or more rows due to erratum.
# * assume that the first row is the oldest one and corresponds tp
# the first publication
# * the row contains empty string when the record is not published.
# * iloc[0] returns a serie where the index are the column's name
#
columns
=
(
self
.
df_info
.
iloc
[
0
]
.
replace
(
""
,
np
.
nan
)
.
dropna
()
.
index
)
missing
=
PAPER_REFERENCE_KEYS
.
difference
(
columns
)
# try to recover from the doi when it has the form
# xx.yyyy/Publisher.Volume.Page
m
=
REG_DOI
.
match
(
self
[
"doi"
])
if
not
m
:
raise
CheckException
(
MSG_NO_REF
+
str
(
list
(
missing
)))
for
subfield
in
missing
:
if
subfield
==
"title"
:
# transform PhysRevD in Phys. Rev. D
li
=
re
.
split
(
r
"([A-Z][a-z]+)"
,
m
.
group
(
1
))
title
=
". "
.
join
([
el
for
el
in
li
if
len
(
el
)
>
0
])
self
.
df_info
.
loc
[
0
,
"title"
]
=
title
elif
subfield
==
"volume"
:
self
.
df_info
.
loc
[
0
,
"volume"
]
=
m
.
group
(
2
)
elif
subfield
==
"pagination"
:
self
.
df_info
.
loc
[
0
,
"pagination"
]
=
m
.
group
(
3
)
elif
subfield
==
"year"
:
raise
CheckException
(
MSG_NO_REF
+
"[year]"
)
def
check_submitted_date
(
self
):
"""Standardise the submitted date as ``YYYY-MM`` or ``YYYY-MM-DD``.
Look for alternative when it is not defined.
...
...
modules/store_tools/recordheppubli.py
View file @
e4ed5623
...
...
@@ -270,11 +270,6 @@ class RecordHepPubli(dict, AuthorsMixin, PublicationInfoMixin):
if
len
(
value
)
==
0
:
raise
CheckException
(
MSG_NO_MY_AUTHOR
)
def
check_paper_reference
(
self
):
"""Check_paper_reference is a dummy method to preserve interface
"""
def
check_submitted_date
(
self
):
"""Check that submitted date is either ``YYYY-MM`` or ``YYYY-MM-DD``.
...
...
tests/basis/test_13_check_and_fix_article_cds.py
View file @
e4ed5623
...
...
@@ -117,6 +117,4 @@ def test_check_publisher_13021(record):
def
test_check_paper_reference_13022
(
record
):
# check_paper_reference is a dummy method to preserve interface
assert
record
.
paper_reference
()
==
"Phys. Rev. D 95 2017 052005"
assert
record
.
check_paper_reference
()
is
None
tests/basis/test_14_check_fix_article_ins.py
View file @
e4ed5623
...
...
@@ -117,7 +117,4 @@ def test_check_publisher_14021(record):
def
test_check_paper_reference_14022
(
record
):
# check_paper_reference is a dummy method to preserve interface
assert
record
.
paper_reference
()
==
"Phys. Rev. D 95 2017 052005"
assert
record
.
check_paper_reference
()
is
None
tests/basis/test_15_check_and_fix_proceeding_cds.py
View file @
e4ed5623
...
...
@@ -120,6 +120,4 @@ def test_check_publisher_15023(record):
def
test_check_paper_reference_15024
(
record
):
# check_paper_reference is a dummy method to preserve interface
assert
record
.
paper_reference
()
==
"J. Phys.: Conf. Ser. 335 2011 012042"
assert
record
.
check_paper_reference
()
is
None
tests/basis/test_16_check_and_fix_proceeding_ins.py
View file @
e4ed5623
...
...
@@ -121,7 +121,4 @@ def test_check_publisher_16023(record):
def
test_check_paper_reference_16024
(
record
):
# check_paper_reference is a dummy method to preserve interface
assert
record
.
paper_reference
()
==
"J. Phys. Conf. Ser. 335 2011 012042"
assert
record
.
check_paper_reference
()
is
None
assert
record
.
paper_reference
()
==
"J. Phys. Conf. Ser. 335 2011 012042"
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