Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto commit from showyourwork tests
Browse files Browse the repository at this point in the history
gh-actions committed Dec 3, 2024
1 parent 049e0f1 commit e1dc61b
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
@@ -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
@@ -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 e1dc61b

Please sign in to comment.