Skip to content

Kill get_journal_and_section #191

@michamos

Description

@michamos

Expected Behavior

As we are now handling journal letters like the rest of the world, we don't need to mangle journal names anymore to conform to Legacy's wrong concept of journal title and volume.

Current Behavior

The get_journal_and_section util is used to split the letter of the volume:

hepcrawl/hepcrawl/utils.py

Lines 302 to 321 in 3b8b456

def get_journal_and_section(publication):
"""Take journal title string and try to extract possible section letter."""
section = ''
journal_title = ''
possible_sections = ["A", "B", "C", "D", "E"]
try:
split_pub = filter(None, re.split(r'(\W+)', publication))
if split_pub[-1] in possible_sections:
section = split_pub.pop(-1)
journal_title = "".join(
[
word
for word in split_pub
if "section" not in word.lower()
]
).strip(", ")
except IndexError:
pass
return journal_title, section
It is not needed and should be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions