2.1. Introduction#
Having to skim through a large unknown codebase can be overwhelming. I hope to convey the essential points necessary to reproduce our results and understand the data to anyone who is interested in our work by providing some examples of how the code can be used.
2.1.1. Getting started#
Make sure to have a virtual environment installed and all dependencies required to run the code (see
installation
),Make sure to configure
lib.config
to setROOT_DIR
,DATA_DIR
,OUTPUT_DIR
constants to tell the scripts where to locate the repository, the datasets and the output files.
2.1.2. Code Example#
The main code is found in lib
and contains all classes and methods necessary to evaluate the data. However, I provide some basic examples of code usage in the form of jupyter notebooks, like this file. It’s a neat mixture of code and text, similar to a Mathematica Notebook. To get familiar with this format, look at the example below.
[1]:
#While we have used a text cell before, we now use a code cell.
# Lets start with some imports to create a simple plot
from matplotlib import rcParams, cycler
import matplotlib.pyplot as plt
import numpy as np
plt.ion()
[1]:
<contextlib.ExitStack at 0x7fe5c2541410>
Next, we create some sample data and plot the results.
[2]:
np.random.seed(19680801)# Fixing random state for reproducibility
N = 10
data = [np.logspace(0, 1, 100) + np.random.randn(100) + ii for ii in range(N)]
data = np.array(data).T
cmap = plt.cm.coolwarm
rcParams['axes.prop_cycle'] = cycler(color=cmap(np.linspace(0, 1, N)))
from matplotlib.lines import Line2D
custom_lines = [Line2D([0], [0], color=cmap(0.), lw=4),
Line2D([0], [0], color=cmap(.5), lw=4),
Line2D([0], [0], color=cmap(1.), lw=4)]
fig, ax = plt.subplots(figsize=(10, 5))
lines = ax.plot(data)
ax.legend(custom_lines, ['Cold', 'Medium', 'Hot'])
[2]:
<matplotlib.legend.Legend at 0x7fe5c242f5d0>

The next pages will be structured in a similar way: there will be some description of what the code is used for, some exemplary code on how to use the routines and the embedded output of the scripts. Please consult the API docs for a more thorough overview.