Skip to content

Commit

Permalink
Merge pull request #6 from espottesmith/main
Browse files Browse the repository at this point in the history
Paper scaffolding
  • Loading branch information
espottesmith authored Aug 12, 2024
2 parents 559da62 + a5e60c6 commit 4554d8f
Show file tree
Hide file tree
Showing 7 changed files with 419 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/draft-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on: [push]

jobs:
paper:
runs-on: ubuntu-latest
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
with:
journal: joss
# This should be the path to the paper within your repo.
paper-path: paper.md
- name: Upload
uses: actions/upload-artifact@v1
with:
name: paper
# This is the output path where Pandoc will write the compiled
# PDF. Note, this should be the same directory as the input
# paper.md
path: paper.pdf
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ build
result
.envrc
.cache
compile_commands.json
compile_commands.json
jats/
65 changes: 65 additions & 0 deletions codemeta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"@context": "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
"@type": "Code",
"author": [
{
"@id": "https://orcid.org/0000-0003-3897-3097",
"@type": "Person",
"email": "[email protected]",
"name": "Laura Zichi",
"affiliation": "University of Michigan - Ann Arbor; Lawrence Berkeley National Laboratory"
},
{
"@id": "https://orcid.org/0000-0002-6408-1255",
"@type": "Person",
"email": "[email protected]",
"name": "Daniel Barter",
"affiliation": "Lawrence Berkeley National Laboratory"
},
{
"@id": "https://orcid.org/0000-0002-6408-1255",
"@type": "Person",
"email": "[email protected]",
"name": "Eric Sivonxay",
"affiliation": "Lawrence Berkeley National Laboratory"
},
{
"@id": "https://orcid.org/0000-0003-1554-197X",
"@type": "Person",
"email": "[email protected]",
"name": "Evan Walter Clark Spotte-Smith",
"affiliation": "Lawrence Berkeley National Laboratory; Univeristy of California - Berkeley"
},
{
"@id": "",
"@type": "Person",
"email": "[email protected]",
"name": "Rohith Srinivaas Mohanakrishnan",
"affiliation": "Lawrence Berkeley National Laboratory; Univeristy of California - Berkeley"
},
{
"@id": "https://orcid.org/0000-0003-2495-5509",
"@type": "Person",
"email": "[email protected]",
"name": "Kristin Aslaug Persson",
"affiliation": "Lawrence Berkeley National Laboratory; Univeristy of California - Berkeley"
},
{
"@id": "https://orcid.org/0000-0003-3132-3032",
"@type": "Person",
"email": "[email protected]",
"name": "Samuel M. Blau",
"affiliation": "Lawrence Berkeley National Laboratory"
}
],
"identifier": "",
"codeRepository": "https://github.com/blauGroup/rnmc",
"datePublished": "2023-06-25",
"dateModified": "2023-06-25",
"dateCreated": "2023-06-25",
"description": "A core high-performance kinetic Monte Carlo (kMC) implementation designed for large reaction networks, with submodules for simulations of various types of physical and chemical systems.",
"keywords": "Python, C++, chemical dynamics, kinetic Monte Carlo",
"license": "UC Regents / LBNL",
"title": "RNMC",
"version": "v1.0.0"
}
146 changes: 146 additions & 0 deletions generate
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
#!/usr/bin/ruby

# For an OO language, this is distinctly procedural. Should probably fix that.
require 'json'

details = Hash.new({})

capture_params = [
{ :name => "title", :message => "Enter project name." },
{ :name => "url", :message => "Enter the URL of the project repository." },
{ :name => "description", :message => "Enter the (short) project description." },
{ :name => "license", :message => "Enter the license this software shared under. (hit enter to skip)\nFor example MIT, BSD, GPL v3.0, Apache 2.0" },
{ :name => "doi", :message => "Enter the DOI of the archived version of this code. (hit enter to skip)\nFor example http://dx.doi.org/10.6084/m9.figshare.828487" },
{ :name => "keywords", :message => "Enter keywords that should be associated with this project (hit enter to skip)\nComma-separated, for example: turkey, chicken, pot pie" },
{ :name => "version", :message => "Enter the version of your software (hit enter to skip)\nSEMVER preferred: http://semver.org e.g. v1.0.0" }
]

puts "I'm going to try and help you prepare some things for your JOSS submission"
puts "If all goes well then we'll have a nice codemeta.json file soon..."
puts ""
puts "************************************"
puts "* First, some basic details *"
puts "************************************"
puts ""

# Loop through the desired captures and print out for clarity
capture_params.each do |param|
puts param[:message]
print "> "
input = gets

details[param[:name]] = input.chomp

puts ""
puts "OK, your project has #{param[:name]}: #{input}"
puts ""
end

puts ""
puts "************************************"
puts "* Experimental stuff *"
puts "************************************"
puts ""

puts "Would you like me to try and build a list of authors for you?"
puts "(You need to be running this script in a git repository for this to work)"
print "> (Y/N)"
answer = gets.chomp

case answer.downcase
when "y", "yes"

# Use git shortlog to extract a list of author names and commit counts.
# Note we don't extract emails here as there's often different emails for
# each user. Instead we capture emails at the end.

git_log = `git shortlog --summary --numbered --no-merges`

# ["252\tMichael Jackson", "151\tMC Hammer"]
authors_and_counts = git_log.split("\n").map(&:strip)

authors_and_counts.each do |author_count|
count, author = author_count.split("\t").map(&:strip)

puts "Looks like #{author} made #{count} commits"
puts "Add them to the output?"
print "> (Y/N)"
answer = gets.chomp

# If a user chooses to add this author to the output then we ask for some
# additional information including their email, ORCID and affiliation.
case answer.downcase
when "y", "yes"
puts "What is #{author}'s email address? (hit enter to skip)"
print "> "
email = gets.chomp

puts "What is #{author}'s ORCID? (hit enter to skip)"
puts "For example: http://orcid.org/0000-0000-0000-0000"
print "> "
orcid = gets.chomp

puts "What is #{author}'s affiliation? (hit enter to skip)"
print "> "
affiliation = gets.chomp


details['authors'].merge!(author => { 'commits' => count,
'email' => email,
'orcid' => orcid,
'affiliation' => affiliation })

when "n", "no"
puts "OK boss..."
puts ""
end
end
when "n", "no"
puts "OK boss..."
puts ""
end

puts "Reticulating splines"

5.times do
print "."
sleep 0.5
end

puts ""
puts "Generating some JSON goodness..."

# TODO: work out how to use some kind of JSON template here.
# Build the output list of authors from the inputs we've collected.
output_authors = []

details['authors'].each do |author_name, values|
entry = {
"@id" => values['orcid'],
"@type" => "Person",
"email" => values['email'],
"name" => author_name,
"affiliation" => values['affiliation']
}
output_authors << entry
end

# TODO: this is currently a static template (written out here). It would be good
# to do something smarter here.
output = {
"@context" => "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld",
"@type" => "Code",
"author" => output_authors,
"identifier" => details['doi'],
"codeRepository" => details['url'],
"datePublished" => Time.now.strftime("%Y-%m-%d"),
"dateModified" => Time.now.strftime("%Y-%m-%d"),
"dateCreated" => Time.now.strftime("%Y-%m-%d"),
"description" => details['description'],
"keywords" => details['keywords'],
"license" => details['license'],
"title" => details['title'],
"version" => details['version']
}

File.open('codemeta.json', 'w') {|f| f.write(JSON.pretty_generate(output)) }
90 changes: 90 additions & 0 deletions paper.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
@article{marcus1965theory,
title={On the theory of electron-transfer reactions. VI. Unified treatment for homogeneous and electrode reactions},
author={Marcus, Rudolph A},
journal={The Journal of Chemical Physics},
volume={43},
number={2},
pages={679--701},
year={1965},
publisher={American Institute of Physics}
}

@article{gillespie1977exact,
title={Exact stochastic simulation of coupled chemical reactions},
author={Gillespie, Daniel T},
journal={The Journal of Physical Chemistry},
volume={81},
number={25},
pages={2340--2361},
year={1977},
publisher={ACS Publications}
}

@techreport{garcia2009crossing,
title={Crossing the mesoscale no-mans land via parallel kinetic Monte Carlo},
author={Garcia Cardona, Cristina and Wagner, Gregory John and Tikare, Veena and Holm, Elizabeth Ann and Plimpton, Steven James and Thompson, Aidan Patrick and Slepoy, Alexander and Zhou, Xiao Wang and Battaile, Corbett Chandler and Chandross, Michael Evan},
year={2009},
institution={Sandia National Laboratories (SNL), Albuquerque, NM, and Livermore, CA}
}

@article{hoffmann2014kmos,
title={kmos: A lattice kinetic Monte Carlo framework},
author={Hoffmann, Max J and Matera, Sebastian and Reuter, Karsten},
journal={Computer Physics Communications},
volume={185},
number={7},
pages={2138--2150},
year={2014},
publisher={Elsevier}
}

@book{newman2021electrochemical,
title={Electrochemical Systems},
author={Newman, John and Balsara, Nitash P},
year={2021},
publisher={John Wiley \& Sons}
}

@article{spotte2022toward,
title={Toward a Mechanistic Model of Solid--Electrolyte Interphase Formation and Evolution in Lithium-Ion Batteries},
author={Spotte-Smith, Evan Walter Clark and Kam, Ronald L and Barter, Daniel and Xie, Xiaowei and Hou, Tingzheng and Dwaraknath, Shyam and Blau, Samuel M and Persson, Kristin A},
journal={ACS Energy Letters},
volume={7},
number={4},
pages={1446--1453},
year={2022},
publisher={ACS Publications}
}

@article{barter2023predictive,
title={Predictive stochastic analysis of massive filter-based electrochemical reaction networks},
author={Barter, Daniel and Spotte-Smith, Evan Walter Clark and Redkar, Nikita S and Khanwale, Aniruddh and Dwaraknath, Shyam and Persson, Kristin A and Blau, Samuel M},
journal={Digital Discovery},
volume={2},
number={1},
pages={123--137},
year={2023},
publisher={Royal Society of Chemistry}
}

@article{spotte2023chemical,
title={Chemical reaction networks explain gas evolution mechanisms in mg-ion batteries},
author={Spotte-Smith, Evan Walter Clark and Blau, Samuel M and Barter, Daniel and Leon, Noel J and Hahn, Nathan T and Redkar, Nikita S and Zavadil, Kevin R and Liao, Chen and Persson, Kristin A},
journal={Journal of the American Chemical Society},
volume={145},
number={22},
pages={12181--12192},
year={2023},
publisher={ACS Publications}
}

@article{Gnach_2012,
title={Lanthanide-doped up-converting nanoparticles: Merits and challenges},
author={Gnach, Anna and Bednarkiewicz, Artur},
journal={Nano Today},
volume={7},
number={6},
pages={532--563},
year={2012},
publisher={Elsevier}
}
Loading

0 comments on commit 4554d8f

Please sign in to comment.