Skip to content

Commit

Permalink
Add script to remove wrong IPAC2023 authors (#54)
Browse files Browse the repository at this point in the history
* Add script to remove wrong IPAC2023 authors

* Auto-format python code

---------

Co-authored-by: michamos <[email protected]>
  • Loading branch information
michamos and michamos authored Dec 6, 2023
1 parent 805831e commit df07a0c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions scripts/remove-wrong-ipac2023-authors/script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from inspirehep.curation.search_check_do import SearchCheckDo

CNUM = "C23-05-07"
AUTHOR_LIST = [
"Assmann, Ralph",
"McIntosh, Peter",
"Fabris, Alessandro",
"Bisoffi, Giovanni",
"Andrian, Ivan",
"Vinicola, Giulia",
]
AUTHOR_QUERY = " and ".join(f"a {author}" for author in AUTHOR_LIST)


class RemoveWrongIPAC2023Authors(SearchCheckDo):
"""Remove incorrect authors on IPAC2023 papers due to bad JACoW metadata."""

query = f"publication_info.cnum:{CNUM} and {AUTHOR_QUERY}"

@staticmethod
def check(record, logger, state):
CNUM in record.get_value("publication_info.cnum", []) and record.get_value(
"authors.full_name", []
) == AUTHOR_LIST

@staticmethod
def do(record, logger, state):
del record["authors"]


RemoveWrongIPAC2023Authors()

0 comments on commit df07a0c

Please sign in to comment.