Skip to content
Draft

Plos #150

Show file tree
Hide file tree
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
10 changes: 2 additions & 8 deletions .github/workflows/paper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,10 @@ jobs:
run: pip install -r requirements.txt

- name: Install LaTeX requirements for matplotlib
run: sudo apt update -y && sudo apt install -y texlive-latex-base texlive-latex-extra cm-super-minimal texlive-fonts-extra latexmk texlive-bibtex-extra biber texlive-lang-german
run: sudo apt update -y && sudo apt install -y build-essential texlive-latex-base texlive-latex-extra cm-super-minimal texlive-fonts-extra latexmk texlive-bibtex-extra biber texlive-lang-german

- name: Create contributor snippet
run: python contributors.py

- name: Create group composition plot
run: cd group_composition_plot && ./create_paper_plots.sh && cd -

- name: Compile paper
run: latexmk -pdf --file-line-error --halt-on-error --interaction=nonstopmode --recorder paper.tex
run: make

- name: move
run: mkdir -p github_artifacts && mv ${{ env.DIR }}/*.pdf ./github_artifacts/
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*.dvi
*.xdv
*-converted-to.*
norm.bib
plos.bib
# these rules might exclude image files for figures etc.
# *.ps
# *.eps
Expand Down
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@ all: plots paper.pdf

clean:
latexmk -c
rm paper.pdf
rm -f paper.pdf paper.bbl plos.bib norm.bib

paper.pdf: paper.tex positionpaper.bib contributors.tex
paper.pdf: paper.tex positionpaper.bib contributors.tex plos.bib
latexmk -pdflatex paper.tex

contributors.tex: contributors.tex.j2 contributors.yml
python3 contributors.py
contributors.tex: contributors.yml contributors_plos.tex.j2
python3 contributors.py $< -t contributors_plos.tex.j2 -o $@

# this step is to convert the input files to proper biblatex files
# so we can turn them into bibtex files later on
norm.bib: positionpaper.bib bibliography.bib
biber --tool $^ --output-file $@

plos.bib: norm.bib
biber --tool $< --output-file $@ \
--configfile=biberconf.xml \
--output-field-replace=location:address,journaltitle:journal

plots::
$(MAKE) -C group_composition_plot
44 changes: 44 additions & 0 deletions biberconf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Got the date from https://gist.githubusercontent.com/mkouhia/f00fea7fc8d4effd9dfd/raw/500e9dbc6aa43a47e39c45ba230738ff4544709f/biblatex-to-bibtex.conf -->
<config>
<output_fieldcase>lower</output_fieldcase>
<output_resolve>1</output_resolve>
<output_safechars>1</output_safechars>
<output_format>bibtex</output_format>
<sourcemap>
<maps datatype="bibtex">
<!-- Easy type conversions -->
<map>
<map_step map_type_source="report" map_type_target="techreport"/>
<map_step map_type_source="online" map_type_target="misc"/>
<map_step map_type_source="dataset" map_type_target="misc"/>
</map>
<!-- Date to year, month -->
<map>
<map_step map_field_source="date"
map_field_target="year" />
</map>
<map>
<map_step map_field_source="year"
map_match="(\d{4}|\d{2})-(\d{1,2})-(\d{1,2})"
map_final="1" />
<map_step map_field_source="year"
map_match="(\d{4}|\d{2})-(\d{1,2})-(\d{1,2})"
map_replace="$1" />
<map_step map_field_set="month" map_origfieldval="1" />
<map_step map_field_source="month"
map_match="(\d{4}|\d{2})-(\d{1,2})-(\d{1,2})"
map_replace="$2" />
</map>
<map>
<map_step map_field_source="year"
map_match="(\d{4}|\d{2})-(\d{1,2})" map_final="1" />
<map_step map_field_source="year"
map_match="(\d{4}|\d{2})-(\d{1,2})" map_replace="$1" />
<map_step map_field_set="month" map_origfieldval="1" />
<map_step map_field_source="month"
map_match="(\d{4}|\d{2})-(\d{1,2})" map_replace="$2" />
</map>
</maps>
</sourcemap>
</config>
11 changes: 1 addition & 10 deletions bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -4725,7 +4725,7 @@ @online{SSIDataScience

@online{SSIRSEandDS,
organization = {Software Sustainability Institute },
author = {Matthew Archer, Stephen Dowsland, Rosa Filgueira, R. Stuart Geiger, Alejandra Gonzalez-Beltran, Robert Haines, James Hetherington, Christopher Holdgraf, Sanaz Jabbari Bayandor, David Mawdsley, Heiko Mueller, Tom Redfern, Martin O'Reilly, Valentina Staneva, Mark Turner, Jake VanderPlas, Kirstie Whitaker},
author = {Archer, Matthew and Dowsland, Stephen and Filgueira, Rosa and Geiger, R. Stuart and Gonzalez-Beltran, Alejandra and Haines, Robert and Hetherington, James and Holdgraf, Christopher and Bayandor, Sanaz Jabbari and Mawdsley, David and Mueller, Heiko and Redfern, Tom and O'Reilly, Martin and Staneva, Valentina and Turner, Mark and VanderPlas, Jake and Whitaker, Kirstie},
title = {Research Software Engineers and Data Scientists: More in Common},
url = {https://www.software.ac.uk/blog/2018-04-05-research-software-engineers-and-data-scientists-more-common},
urldate = {2023-08-04}
Expand Down Expand Up @@ -5680,15 +5680,6 @@ @article{smith_SoftwareCitationPrinciples2016
doi = {10.7717/peerj-cs.86}
}

@Article{goth_foundational_competencies_2024,
title={Foundational Competencies and Responsibilities of a Research Software Engineer},
author={Goth, Florian and Alves, Renato and Braun, Matthias and Castro, Leyla Jael and Chourdakis, Gerasimos and Christ, Simon and Cohen, Jeremy and Druskat, Stephan and Erxleben, Fredo and Grad, Jean-No{\"e}l and Hagdorn, Magnus and Hodges, Toby and Juckeland, Guido and Kempf, Dominic and Lamprecht, Anna-Lena and Linxweiler, Jan and L{\"o}ffler, Frank and Martone, Michele and Schwarzmeier, Moritz and Seibold, Heidi and Thiele, Jan Philipp and von Waldow, Harald and Wittke, Samantha},
year={2024},
journal={arXiv},
volume={2311.11457},
doi={10.48550/arXiv.2311.11457},
}

@InProceedings{haupt_hifis_consulting_2021,
author = {Haupt, Carina and Stoffers, Martin},
title = {Roles in Research Software Engineering ({RSE}) Consultancies},
Expand Down
78 changes: 54 additions & 24 deletions contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,65 @@
import jinja2
import os
import yaml
import argparse
from pathlib import Path


with open("contributors.yml") as f:
data = yaml.safe_load(f)
def main():

# Sort by last name and contribution tier
data["authors"] = list(sorted(sorted(data["authors"], key=lambda x: x["lastName"]), key=lambda x: x.get("tier", 2)))
parser = argparse.ArgumentParser()
parser.add_argument("contributors", type=Path,
help="yml file containing the contributors")
parser.add_argument("-t", "--template", type=Path, required=True,
help="name of template to use")
parser.add_argument("-o", "--output", type=Path,
help="the name of the output file")
args = parser.parse_args()

# Ensure that we have unique indices for the affiliations
affiliations = list()
for author in data["authors"]:
if 'affiliations' in author:
affiliations.extend(author["affiliations"])
# make sure affiliations are not duplicated - here by checking for exact name string
affiliations = list({aff['name']: aff for aff in affiliations}.values())
with args.contributors.open('r') as f:
data = yaml.safe_load(f)

# create and add unique index and also a reverse lookup table
data["affiliations"] = {i + 1: aff for i, aff in enumerate(affiliations)}
aff_index_by_name = {aff['name']: i for i, aff in data["affiliations"].items()}
# Sort by last name and contribution tier
data["authors"] = list(
sorted(
sorted(data["authors"], key=lambda x: x["lastName"]),
key=lambda x: x.get("tier", 2)))

# attach index to authors
for author in data["authors"]:
if 'affiliations' in author:
author["affiliations"] = [aff_index_by_name[aff['name']] for aff in author["affiliations"]]
# Ensure that we have unique indices for the affiliations
affiliations = []
for author in data["authors"]:
if 'affiliations' in author:
affiliations.extend(author["affiliations"])
if 'corresponding_author' in author and author['corresponding_author']:
data['corresponding_author'] = author['email']
# make sure affiliations are not duplicated - here by checking
# for exact name string
affiliations = list({aff['name']: aff for aff in affiliations}.values())

env = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.getcwd()),
keep_trailing_newline=True,
)
# create and add unique index and also a reverse lookup table
data["affiliations"] = {i + 1: aff for i, aff in enumerate(affiliations)}
aff_index_by_name = {
aff['name']: i for i, aff in data["affiliations"].items()}

with open("./contributors.tex", "w") as out:
out.write(env.get_template("contributors.tex.j2").render(data=data))
# attach index to authors
for author in data["authors"]:
if 'affiliations' in author:
author["affiliations"] = [
aff_index_by_name[
aff['name']] for aff in author["affiliations"]]

env = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.getcwd()),
keep_trailing_newline=True,
)

contribs = env.get_template(args.template.name).render(data=data)

if args.output is not None:
args.output.write_text(contribs)
else:
print(contribs)


if __name__ == '__main__':
main()
1 change: 1 addition & 0 deletions contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ authors:
firstName: Dominic
lastName: Kempf
initials: DK
corresponding_author: true
affiliations:
- name: Scientific Software Center, Heidelberg University, Germany
ror: https://ror.org/038t36y30
Expand Down
22 changes: 22 additions & 0 deletions contributors_plos.tex.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
% README: The file contributors.tex is automatically generated by running contributors.py.
% Changed within will be OVERWRITTEN.
% For changes to the tex template, change contributors.tex.j2.
% For changes to the author information, change contributors.yml.
%
% Note: the zero-width character <200b> is in here on purpose (to not mess up authors without
% affiliation)
{%- for author in data.authors %}
{{ author.author }}​{% if author.affiliations %}\textsuperscript{{ "{" }}{{ author.affiliations|join(",") }}{% if author.corresponding_author is defined and author.corresponding_author %}*{% endif %}{% if author.orcid is defined %}\texorpdfstring{\thinspace\orcidlink{ {{-author.orcid-}} }}{}{% endif %}{{ "}" }}{% endif %}
{%- endfor %}
\\
\bigskip
{%- for index, affiliation in data.affiliations.items() %}
\textbf{{ "{" }}{{ index }}{{ "}" }} {{ affiliation.name }}{% if affiliation.ror is defined %}\texorpdfstring{\thinspace\rorlink{ {{-affiliation.ror-}} }} {}{% endif %}
\\
{%- endfor %}
\bigskip
{% if data.corresponding_author is defined %}

* {{ data.corresponding_author }}
{% endif %}

Loading
Loading