Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kill get_journal_and_section #191

Open
michamos opened this issue Nov 15, 2017 · 0 comments
Open

Kill get_journal_and_section #191

michamos opened this issue Nov 15, 2017 · 0 comments

Comments

@michamos
Copy link
Contributor

michamos commented Nov 15, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants