TRENTo/Bayesian Analysis for the JETSCAPE Online Summer School 2020.
These examples run with python3
on a Jupyter Notebook
. It does not require docker.
We provided two options to either install the dependencies using Anaconda (recommended) or simply run the code from an online session supported by Binder.
-
Download and install
Conda
1.1. Download
Miniconda
(a free minimal version of Anaconda) for Python 3.7 from here. Remember to choosePython3
(3.7) and the corrected installer for your operating system.1.2. Execute the downloaded installer, and follow the instructions to install. It will ask you where to put conda (Default is
$HOME
). After the installation,conda
command can be called in shell (for Mac / Linux). For Windows, you can findanaconda prompt
from your start menu to open a shell environment. -
Clone the repository and download data files
2.1. Clone the current repository to a directory, for example
$HOME/JS2020
.mkdir $HOME/JS2020 && cd $HOME/JS2020 git clone https://github.com/keweiyao/JETSCAPE2020-TRENTO-BAYES.git
2.2. Using the script
postBuild
to down the datacd $HOME/JS2020/JETSCAPE2020-TRENTO-BAYES bash postBuild
Now
ls
and you should see the downloaded folderModelData/
. -
Create conda virtual environment and test the notebook
3.1. Create conda virtual environment.
conda env create -f environment.yml
This should create a virtual environment called
trento-bayes
. You can check if it exists and its location byconda env list
. The required libraries are installed in this environment (these libraries are listed inenvironment.yml
, except foremcee
package, which is listed in thepip
requirements.txt
). If you want to delete this environment after the lecture, you can doconda env remove -n <name-of-environment>
.3.2. To activate the environment
conda activate trento-bayes
To deactivate the environment
conda deactivate
3.3. Within the folder that contains the examples, open jupyter notebook,
jupyter notebook
From the prompt of the browser, click and open the file
trento-bayes.ipynb
3.4. Move to the first block, press
Shift+Enter
to see if you can run the first two or three blocks successfully. Then you are good to go!
This Binder environment holds online session of interactive Jupyter notebook
.
Simple check the following link and wait for the environment to build and load.
Binder link.
The advantage is that you don't need to install the dependence on your computer.
The disadvantages:
- The initial build of the image can take upto 5 mins.
- Require fast and stable internet connection. Once you lost connection, you will need to restart.
- The computational power of the binder server is limited. So for some examples with significant amount of computation, the computing time can be too long for the lecture. Therefore, I also uploaded pre-calculated results for these examples that you can simply load and study.
If you have time, you are encouraged to checkout materials from eariler JETSCAPE schools.