Skip to content

Commit b93629b

Browse files
author
gh-actions
committed
auto commit from showyourwork tests
1 parent b5b259f commit b93629b

4 files changed

Lines changed: 25 additions & 1 deletion

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
</a>
1616
</p>
1717

18-
An open source scientific article created using the [showyourwork](https://github.com/showyourwork/showyourwork) workflow.
18+
*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).*
19+
20+
Test a workflow with dynamic quantities imported into the tex file.

Snakefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
3+
4+
rule age_of_universe:
5+
output:
6+
'src/tex/output/age_of_universe.txt'
7+
script:
8+
'src/scripts/age_of_universe.py'

src/scripts/age_of_universe.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
import paths
3+
import numpy as np
4+
5+
# Compute the age of the universe
6+
np.random.seed(42)
7+
age = np.random.normal(14.0, 1.0)
8+
9+
# Write it to disk
10+
with open(paths.output / "age_of_universe.txt", "w") as f:
11+
f.write(f"{age:.3f}")
12+

src/tex/ms.tex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,6 @@ \section{Introduction}
5959

6060
\bibliography{bib}
6161

62+
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.
6263
\end{document}
64+

0 commit comments

Comments
 (0)