Skip to content

Commit 93dbe0b

Browse files
add content to episode 2 - installation
1 parent 2c3aa2f commit 93dbe0b

File tree

1 file changed

+108
-4
lines changed

1 file changed

+108
-4
lines changed

_episodes/02-installation.md

Lines changed: 108 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,117 @@ title: "Installation"
33
teaching: 0
44
exercises: 0
55
questions:
6-
- "Key question (FIXME)"
6+
- "What are the prerequisites for installing ESMValTool?"
7+
- "How do I confirm that the installation was succesful?"
78
objectives:
8-
- "First learning objective. (FIXME)"
9+
- "Execute a succesful ESMValTool installation"
910
keypoints:
10-
- "First key point. Brief Answer to questions. (FIXME)"
11+
- "ESMValTool is installed from source code that lives in the [GitHub repository](https://github.com/ESMValGroup/ESMValTool)"
12+
- "All the required packages can be installed using conda and the [environment.yml file](https://github.com/ESMValGroup/ESMValTool/blob/master/environment.yml)"
13+
- "You can find more information about installation in the [documentation](https://esmvaltool.readthedocs.io/en/latest/getting_started/install.html)"
1114
---
12-
FIXME
15+
16+
> ## Attention
17+
>
18+
> * This episode is based on the ESMValTool installation instructions, for more information and advanced cases you can visit the ESMValTool [documentation](https://esmvaltool.readthedocs.io/en/latest/getting_started/install.html).
19+
> * For this episode it is assumed you have knowledge of [git](https://git-scm.com/) you can refresh your knowledge in the corresponding [git carpentries course](http://swcarpentry.github.io/git-novice/).
20+
{: .callout}
21+
22+
## Obtaining the source code
23+
24+
The ESMValTool source code is available on a public GitHub repository:
25+
https://github.com/ESMValGroup/ESMValTool
26+
27+
The easiest way to obtain it is to clone the repository using git.
28+
To clone the public repository open a terminal window and type:
29+
30+
~~~
31+
git clone https://github.com/ESMValGroup/ESMValTool.git
32+
~~~
33+
{: .source}
34+
35+
By default, this command will create a folder called ESMValTool containing the
36+
source code of the tool.
37+
38+
Move into the directory to continue installation.
39+
40+
> ## Attention
41+
>
42+
> Make sure that the master branch is checked out before continuing intallation:
43+
> ~~~
44+
> git checkout master
45+
> ~~~
46+
> {: .source}
47+
{: .callout}
48+
49+
## Prerequisites
50+
51+
It is recommended to use conda to manage ESMValTool dependencies.
52+
For a minimal conda installation go to https://conda.io/miniconda.html. To
53+
simplify the installation process, an environment definition file is provided
54+
in the repository (``environment.yml`` in the root folder).
55+
56+
> ## Attention
57+
> It is preferable to use a local, fully user-controlled conda installation.
58+
> If you have conda installed already, make sure it is up to date by running ``conda update -n base conda``.
59+
{: .callout}
60+
61+
From now on, we will assume that the installation is going to be done through
62+
conda.
63+
64+
Ideally, you should create a conda environment for ESMValTool, so it is
65+
independent from any other Python tools present in the system.
66+
67+
To create an environment, go to the directory containing the ESMValTool source
68+
code (called ESMValTool if you did not choose a different name) and run
69+
70+
~~~
71+
conda env create --name esmvaltool --file environment.yml
72+
~~~
73+
{: .source}
74+
75+
The environment is called ``esmvaltool`` by default, but it is possible to use
76+
the option ``--name ENVIRONMENT_NAME`` to define a custom name. You can activate
77+
the environment using the command:
78+
79+
~~~
80+
conda activate esmvaltool
81+
~~~
82+
{: .source}
83+
84+
If you run into trouble, please try recreating the environment. More information can be found in the (conda documentation)[https://docs.conda.io/en/latest/].
85+
86+
87+
## Software installation
88+
89+
Once all prerequisites are fulfilled, ESMValTool can be installed by running
90+
the following commands in the directory containing the ESMValTool source code:
91+
92+
~~~
93+
pip install .
94+
~~~
95+
{: .source}
96+
97+
## Test the installation
98+
99+
The next step is to check that the installation works properly.
100+
To do this, run the tool with:
101+
102+
~~~
103+
esmvaltool --help
104+
~~~
105+
{: .source}
106+
107+
If everything was installed properly, ESMValTool should have printed a
108+
help message to the console.
109+
110+
For a more complete installation verification, run the automated tests and
111+
confirm that no errors are reported:
112+
113+
~~~
114+
python setup.py test --installation
115+
~~~
116+
{: .source}
13117
14118
{% include links.md %}
15119

0 commit comments

Comments
 (0)