diff --git a/contributors.py b/contributors.py index f30ef5b..f3cd49a 100755 --- a/contributors.py +++ b/contributors.py @@ -3,10 +3,23 @@ import os import yaml +CORRESPONDING_AUTHOR = "Kempf" with open("contributors.yml") as f: data = yaml.safe_load(f) +# sort list of authors by last name +sorted_authors = sorted(data["authors"], key=lambda a: a["lastName"]) +# and move corresponding author to front of the list +idx = None +for i, a in enumerate(sorted_authors): + if a["lastName"] == CORRESPONDING_AUTHOR: + idx = i + break +if idx is not None: + sorted_authors.insert(0, sorted_authors.pop(idx)) +data["authors"] = sorted_authors + # Ensure that we have unique indices for the affiliations affiliations = list() for author in data["authors"]: diff --git a/contributors.yml b/contributors.yml index 4e5f968..c6c98e1 100644 --- a/contributors.yml +++ b/contributors.yml @@ -83,6 +83,8 @@ authors: email: j.linxweiler@tu-braunschweig.de - author: "Axel Loewe" + firstName: Axel + lastName: Loewe - author: "Frank Löffler" firstName: Frank