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 Dec 2, 2024
1 parent 7ce52d2 commit 9683e1d
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 9683e1d

Please sign in to comment.