# Reproducible simulations in a tarball with toml-file

**URL:** <https://discourse.julialang.org/t/reproducible-simulations-in-a-tarball-with-toml-file/42775>\
**Category:** General Usage\
**Tags:** package, reproducibility\
**Created:** [July 9, 2020, 7:10am UTC](https://discourse.julialang.org/t/reproducible-simulations-in-a-tarball-with-toml-file/42775 "2020-07-09T07:10:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jarl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jarl/32/4365_2.png) [@jarl](https://discourse.julialang.org/u/jarl)\
**Post date:** [July 9, 2020, 7:10am UTC](https://discourse.julialang.org/t/reproducible-simulations-in-a-tarball-with-toml-file/42775/1 "2020-07-09T07:10:30Z")

</div>

We have a use-case which should not be totally uncommon: We have a couple of julia scripts that illustrate / simulate something in a research paper. In our case it reproduces some figures in the paper. In order for a reader to easily try out the script, we want to provide it as a tar-ball on a web-page (our own web page, not a github). The correct package versions is crucial. Someone indicated that the right way to do get the right package version is with toml-files.

1. Given a script, how can I generate toml-files with the requirements of what it runs. Since the goal is reproducibility, the exact version number of the current packages would probably be the best choice. I would prefer not to have edit toml-files by hand.

2. How does a reader of the paper install exactly the same versions of the packages as specified in the toml-file?

---

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [July 9, 2020, 7:23am UTC](https://discourse.julialang.org/t/reproducible-simulations-in-a-tarball-with-toml-file/42775/2 "2020-07-09T07:23:53Z")

</div>

The toml files are generated by the usual pkg commands : `add`, etc. Your use case is exactly what project environments are made for:

[https://julialang.github.io/Pkg.jl/v1/environments/](https://julialang.github.io/Pkg.jl/v1/environments/)

---

<div class="post-metadata">

**Author:** ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Post date:** [July 9, 2020, 7:28am UTC](https://discourse.julialang.org/t/reproducible-simulations-in-a-tarball-with-toml-file/42775/3 "2020-07-09T07:28:39Z")

</div>

I’d recommend spending a little bit of time and wrap your project in [DrWatson.jl](https://github.com/JuliaDynamics/DrWatson.jl) which was made exactly for this purpose. In the documentation you also find a very nice overview how such a project can be initialised with ease.

But in general, yes, a `Project.toml` will describe the environment and the dependencies and a `Manifest.toml` will even set each of them to a very specific version, so your environment will be fully reproducible.

Here is a quick tutorial in the DrWatson docs, it’s really easy to set it up: [DrWatson Workflow Tutorial · DrWatson](https://juliadynamics.github.io/DrWatson.jl/dev/workflow/)

---

<div class="post-metadata">

**Author:** ![jarl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jarl/32/4365_2.png) [@jarl](https://discourse.julialang.org/u/jarl)\
**Post date:** [July 9, 2020, 7:37am UTC](https://discourse.julialang.org/t/reproducible-simulations-in-a-tarball-with-toml-file/42775/4 "2020-07-09T07:37:44Z")

</div>

Thanks. DrWatson does indeed seems to do exactly this and a bit more.
