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

JOSS paper draft #23

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ docs/_build
# test related
test.rea
test*.f*

# paper
paper.pdf
paper/.bundle
paper/.whedon
68 changes: 68 additions & 0 deletions codemeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "Code",
"identifier": "pymech",
"name": "pymech",
"version": "1.4.0",
"description": "A Python suite of routines for Nek5000 and Simson.",
"license": "GNU General Public License v3 or later (GPLv3+), OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"author": [
{
"@id": "https://orcid.org/0000-0002-2979-6327",
"@type": "Person",
"email": "[email protected]",
"givenName": "Ashwin Vishnu",
"familyName": "Mohanan",
"affiliation": "Stockholm University, Stockholm, Sweden"
},
{
"@type": "Person",
"givenName": "Guillaume",
"familyName": "Chauvat",
"affiliation": "KTH Royal Institute of Technology, Stockholm, Sweden"
},
{
"@type": "Person",
"givenName": "Nicolo",
"familyName": "Fabbiane",
"affiliation": "ONERA, Paris, France"
},
{
"@type": "Person",
"givenName": "Jacopo",
"familyName": "Canton",
"affiliation": "ETH Zürich, Zürich, Switzerland"
}

],
"audience": [
{
"@type": "Audience",
"audienceType": "Science/Research"
}
],
"codeRepository": "https://github.com/jcanton/pymech.git",
"issueTracker": "https://github.com/jcanton/pymech/issues",
"programmingLanguage": "Python",
"datePublished": "2020-03-12",
"dateModified": "2020-11-16",
"dateCreated": "2016-01-21",
"keywords": [
"CFD",
"fluid dynamics",
"post-processing",
"Nek5000",
"SIMSON",
"file I/O"
],
"title": "Pymech: A Python suite of routines for Nek5000 and Simson",
"provider": {
"@id": "https://pypi.org",
"@type": "Organization",
"name": "The Python Package Index",
"url": "https://pypi.org"
},
"runtimePlatform": "Python 3",
"url": "https://github.com/jcanton/pymech",
"operatingSystem": "OS Independent"
}
23 changes: 23 additions & 0 deletions paper/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Setup Ruby and execute `bundle install` to get whedon
OPENJOURNALS_PATH := .whedon/resources

draft: paper.pdf

paper.pdf: paper.md paper.bib
pandoc -o paper.pdf -V documentclass=scrartcl -V geometry:margin=1in --pdf-engine=xelatex --citeproc paper.md


joss: paper.md paper.bib .whedon
pandoc \
--defaults=joss-defaults.yaml \
--data-dir=$(OPENJOURNALS_PATH) \
--resource-path=.:$(OPENJOURNALS_PATH) \
--csl=$(OPENJOURNALS_PATH)/apa.csl \
--template=$(OPENJOURNALS_PATH)/joss/latex.template \
--lua-filter=$(OPENJOURNALS_PATH)/time.lua \
--metadata=aas_logo_path:$(OPENJOURNALS_PATH)/joss/aas-logo.png \
--metadata=logo_path:$(OPENJOURNALS_PATH)/joss/logo.png \
$<

.whedon:
git clone https://github.com/openjournals/whedon $@
79 changes: 79 additions & 0 deletions paper/generate_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
"""Generate pandoc metadata from codemeta.json"""
import sys
from collections import OrderedDict
from json import load
from pathlib import Path
from datetime import datetime

import ruamel.yaml


here = Path.cwd()

with (here.parent / "codemeta.json").open() as fp:
cm = load(fp)


# print(cm)


def ordered_set(iterable):
return OrderedDict.fromkeys(iterable).keys()


uniq_affiliations = list(ordered_set(author["affiliation"] for author in cm["author"]))


def make_author(author):
data = {
"name": " ".join([author["givenName"], author["familyName"]]),
"affiliation": uniq_affiliations.index(author.get("affiliation", "")) + 1,
}
orcid_url = author.get("@id")
if orcid_url:
data.update({"orcid": Path(orcid_url).name})
return data


def make_affiliations():
return [{"name": name, "index": i + 1} for i, name in enumerate(uniq_affiliations)]


def make_date(date):
date_parsed = datetime.strptime(date, "%Y-%m-%d")
return datetime.strftime(date_parsed, "%d %B %Y")


# Prepare data for metadata output
data = {
"title": cm.get("title", ""),
"tags": cm.get("keywords", []),
"authors": [make_author(_) for _ in cm.get("author", [{}])],
"affiliations": make_affiliations(),
"date": make_date(cm.get("dateModified", "")),
"bibliography": "paper.bib",
}


# FIXME: New API wraps dictionaries
# yaml = ruamel.yaml.YAML(typ='safe')
# yaml.compact(seq_seq=False, seq_map=False)
# yaml.allow_unicode = True
# yaml.indent(sequence=4, offset=2, mapping=4)
def dump(data, dest):
# yaml.dump(data, dest)
ruamel.yaml.dump(
data,
dest,
explicit_start=True,
allow_unicode=True,
Dumper=ruamel.yaml.RoundTripDumper,
)


dest = sys.stdout
dump(data, dest)
# output = here / "metadata.yaml"
# dest = output.open("w")
# with output.open("w") as dest:
# dump(data, dest)
48 changes: 48 additions & 0 deletions paper/joss-defaults.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Combined from joss/defaults.yaml and docker-defaults.yaml file in whedon repository
from: markdown
to: latex
output-file: paper.pdf
standalone: true

# note that structured variables may be specified:
variables:
archive_doi: 'DOI unavailable'
doi_batch_id: 'N/A'
editor_url: 'https://example.com'
formatted_doi: 'DOI unavailable'
repository: 'NO_REPOSITORY'
review_issue_url: 'N/A'
paper_url: 'NO PAPER URL'
joss_resource_url: 'N/A'
journal_abbrev_title: 'JOSS'
journal_alias: 'joss'
journal_issn: '2475-9066'
journal_name: 'Journal of Open Source Software'
journal_url: 'https://joss.theoj.org/'

metadata:
citation_author: '¿citation_author?'
editor_name: 'Pending Editor'
issue: '¿ISSUE?'
page: '¿PAGE?'
published: 'N/A'
reviewers:
- 'Pending Reviewers'
submitted: 'N/A'
volume: '¿VOL?'

# resource-path: [".", '/usr/local/share/openjournals']

filters:
- citeproc

# ERROR, WARNING, or INFO
verbosity: INFO

pdf-engine: xelatex
dpi: 300

default-image-extension: ".png"
reference-links: true
fail-if-warnings: true

81 changes: 81 additions & 0 deletions paper/paper.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

@book{AyachitParaView2015,
title = {The {{ParaView Guide}}: {{A Parallel Visualization Application}}},
shorttitle = {The {{ParaView Guide}}},
author = {Ayachit, Utkarsh},
year = {2015},
publisher = {{Kitware, Inc.}},
address = {{Clifton Park, NY, USA}},
isbn = {978-1-930934-30-6}
}

@book{Chevalier.etalSIMSON2007,
title = {{{SIMSON}}: A Pseudo-Spectral Solver for Incompressible Boundary Layer Flows},
shorttitle = {{{SIMSON}}},
author = {Chevalier, Mattias and Schlatter, Philipp and Lundbladh, Anders and Henningson, Dan S.},
year = {2007},
publisher = {{Mekanik, Kungliga Tekniska h\"ogskolan}},
address = {{Stockholm}},
url = {https://www.mech.kth.se/~mattias/simson-user-guide-v4.0.pdf},
annotation = {OCLC: 234048689},
isbn = {978-91-7178-838-2},
language = {en}
}

@inproceedings{Childs.etalContract2005,
title = {A Contract Based System for Large Data Visualization},
booktitle = {{{VIS}} 05. {{IEEE Visualization}}, 2005.},
author = {Childs, H. and Brugger, E. and Bonnell, K. and Meredith, J. and Miller, M. and Whitlock, B. and Max, N.},
year = {2005},
month = oct,
pages = {191--198},
doi = {10.1109/VISUAL.2005.1532795},
keywords = {Concurrent computing,contract based system,Contracts,Data analysis,data flow computing,data visualisation,Data visualization,featured visualization tool,Geometry,Graphics,Hardware,Laboratories,Pipelines,Rendering (computer graphics),very large databases,VisIt data flow network design}
}

@article{Harris.etalArray2020,
title = {Array Programming with {{NumPy}}},
author = {Harris, Charles R. and Millman, K. Jarrod and {van der Walt}, St{\'e}fan J. and Gommers, Ralf and Virtanen, Pauli and Cournapeau, David and Wieser, Eric and Taylor, Julian and Berg, Sebastian and Smith, Nathaniel J. and Kern, Robert and Picus, Matti and Hoyer, Stephan and {van Kerkwijk}, Marten H. and Brett, Matthew and Haldane, Allan and {del R{\'i}o}, Jaime Fern{\'a}ndez and Wiebe, Mark and Peterson, Pearu and {G{\'e}rard-Marchant}, Pierre and Sheppard, Kevin and Reddy, Tyler and Weckesser, Warren and Abbasi, Hameer and Gohlke, Christoph and Oliphant, Travis E.},
year = {2020},
month = sep,
volume = {585},
pages = {357--362},
publisher = {{Nature Publishing Group}},
issn = {1476-4687},
doi = {10.1038/s41586-020-2649-2},
url = {https://www.nature.com/articles/s41586-020-2649-2},
urldate = {2020-09-25},
journal = {Nature},
language = {en},
number = {7825}
}

@article{Hoyer.HammanXarray2017,
title = {Xarray: {{N}}-{{D}} Labeled {{Arrays}} and {{Datasets}} in {{Python}}},
shorttitle = {Xarray},
author = {Hoyer, Stephan and Hamman, Joe},
year = {2017},
month = apr,
volume = {5},
pages = {10},
publisher = {{Ubiquity Press}},
issn = {2049-9647},
doi = {10.5334/jors.148},
url = {http://openresearchsoftware.metajnl.com/articles/10.5334/jors.148/},
urldate = {2021-03-09},
journal = {Journal of Open Research Software},
keywords = {data analysis,data; data handling,multidimensional,netCDF,pandas,Python},
language = {en},
number = {1}
}

@misc{NEK50002019,
title = {{{NEK5000}} Version 19.0},
year = {2019},
month = dec,
url = {https://nek5000.mcs.anl.gov/},
urldate = {2021-03-17},
howpublished = {Argonne National Laboratory, Illinois}
}


Loading