Skip to content

Commit

Permalink
auto commit from showyourwork tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gh-actions committed Nov 7, 2023
1 parent b5982d3 commit 01ff547
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@
</a>
</p>

An open source scientific article created using the [showyourwork](https://github.com/showyourwork/showyourwork) workflow.
*This is an automatically generated test for [showyourwork](https://github.com/showyourwork/showyourwork) generated from the file [test_variable.py](https://github.com/showyourwork/showyourwork/blob/main/tests/integration/test_variable.py).*

Test a workflow with dynamic quantities imported into the tex file.
8 changes: 8 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@



rule age_of_universe:
output:
'src/tex/output/age_of_universe.txt'
script:
'src/scripts/age_of_universe.py'
12 changes: 12 additions & 0 deletions src/scripts/age_of_universe.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

import paths
import numpy as np

# Compute the age of the universe
np.random.seed(42)
age = np.random.normal(14.0, 1.0)

# Write it to disk
with open(paths.output / "age_of_universe.txt", "w") as f:
f.write(f"{age:.3f}")

2 changes: 2 additions & 0 deletions src/tex/ms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ \section{Introduction}

\bibliography{bib}

Based on a detailed analysis of Planck observations of the cosmic microwave background, we have determined the age of the universe to be \variable{output/age_of_universe.txt} Gyr.
\end{document}

0 comments on commit 01ff547

Please sign in to comment.