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

Fixed bugs + added option for journals #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions authors.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument('auth_tsv')
parser.add_argument('affil_tsv')
parser.add_argument('--journal', type=str, default='apj',
help='Journal format. Currenly supported are apj and nature')
parser.add_argument('--discard', type=int, default=3,
help='Number of lines to discard from the top of the authors spreadsheet, default %(default)')
help='Number of lines to discard from the top of the authors spreadsheet')
parser.add_argument('--discard-affil', type=int, default=1,
help='Number of lines to discard from the top of the affiliations spreadsheet, default %(default)')
help='Number of lines to discard from the top of the affiliations spreadsheet')

# Here we assume the spreadsheet has columns:
#
Expand Down Expand Up @@ -107,7 +109,7 @@ def main():
authors = [authors[i] for i in I]

# ApJ format
if True:
if opt.journal == 'apj':
for auth,orcid,affil in authors:
orctxt = ''
if len(orcid):
Expand All @@ -117,7 +119,7 @@ def main():
print(' \\affiliation{%s}' % affilmap.get(aff, aff))

# Nature format
if False:
elif opt.journal == 'nature':
txt = []
uaffils = []
txt.append('\\author{')
Expand Down Expand Up @@ -147,6 +149,10 @@ def main():
txt.append('\\end{affiliations}')
txt.append('}')
print('\n'.join(txt))

# Journal not recognized
else:
raise NotImplemented("Journal name not found")

acks = list(set(acks))
acks.sort()
Expand Down