Skip to content

Commit da5065b

Browse files
authored
Merge pull request #21 from pp-mo/geovista_release
Update to geovista 0.1.1
2 parents d284a7d + 671f59c commit da5065b

File tree

3 files changed

+97
-99
lines changed

3 files changed

+97
-99
lines changed

README.md

Lines changed: 36 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -6,45 +6,18 @@ The content is all written as interactive Jupyter notebooks,
66
which combine presenter information and student exercises.
77

88
## Get a suitable Python environment to run the notebooks
9-
A suitable fresh environment can be created from the list of required packages with conda, using :
10-
e.g. `$ conda env create --name meshtut_newest_env --file tutorial_conda_env.yml`
11-
12-
However, this may break as newer package versions are released.
13-
14-
So, we also provide a "lockfile" which ties down all package versions, from which a
15-
known-good environment can be recreated :
16-
e.g. `$ conda create --name meshtut_savefixed_env --file tutorial_conda_env_resolved.lock`
17-
18-
> :warning: **Important Note**
19-
> For now, the latest GeoVista build in channels is not sufficient.
20-
> You must also download geovista + install it, e.g. by `pip install -e .`
21-
### Installing Geovista : more-or-less detailed instructions
22-
You need to execute commands something like this ...
23-
24-
```bash
25-
$ # download
26-
$ cd ~/git
27-
$ git clone https://github.com/bjlittle/geovista.git
28-
$
29-
$ # install in the env
30-
$ conda activate mesh-tutorial
31-
$ cd ~/git/geovista
32-
$ pip install -e .
33-
... (lots of output) ...
34-
$
35-
$ # TEST that the import now works ...
36-
$ python -c "import geovista as gv; print(gv); print(gv.__version__)"
37-
<module 'geovista' from '/net/home/h05/itpp/git/geovista/src/geovista/__init__.py'>
38-
0.1a1.dev508
39-
40-
$
41-
```
9+
10+
For guaranteed operation with tested package versions, create a environment from the provided "lockfile", as follows :
11+
`$ conda create --name meshtut_safelocked_env --file tutorial_conda_env_resolved.lock`
4212

4313

4414
## Start the tutorial
15+
Run Jupyter lab, in the chosen Python environment.
16+
**NOTE:** _always_ start it in the `/notebooks` directory.
17+
4518
E.G.
4619
```
47-
$ conda activate meshtut_savefixed_env
20+
$ conda activate meshtut_safelocked_env
4821
$ cd iris-mesh-tutorial/notebooks
4922
$ jupyter lab
5023
[I 2023-01-12 15:39:10.730 ServerApp] jupyter_server_terminals | extension was successfully linked.
@@ -63,27 +36,40 @@ $ jupyter lab
6336
http://localhost:8888/lab?token=c4ece2e59cd8c81779de0f394c421e22f258f50466cc027e
6437
or http://127.0.0.1:8888/lab?token=c4ece2e59cd8c81779de0f394c421e22f258f50466cc027e
6538
```
66-
A window should then appear in your browser.
39+
**A window should then appear in your browser.**
6740
Failing that, visit one of the urls displayed in the terminal output.
6841

42+
### Get Started
43+
Open the notebook `Mesh_Tutorial_Intro.ipynb`.
44+
6945

7046
## Developer notes: to build the lockfile
71-
The lockfile "tutorial_conda_env_resolved.lockfile" is produced from an actual environment.
72-
First build the env from the spec file "tutorial_conda_env.yml" ...
47+
The lockfile `tutorial_conda_env_resolved.lock` is produced from an actual resolved environment.
7348

74-
First using a conda env with "mamba" in it : resolve the env + snapshot the package list.
49+
To build a working env with all-latest packages, do the following :
7550

76-
```bash
77-
$ conda activate mamba-env
78-
$ mamba create -n mesh-tutorial --file tutorial_conda_env.yml
79-
$ conda list -n mesh-tutorial --explicit >temp_condalist_explicit.txt
80-
```
51+
**Step 1:** build a fresh env from the spec
8152

82-
Then using a conda env with 'ssstack' in it (https://github.com/MetOffice/ssstack) : generate new 'shareable'-form lockfile.
53+
* The env spec is in the file `tutorial_conda_env.yml`
54+
* use a conda env with "mamba" in it (since conda is likely to take ages and/or run out of memory)
55+
* resolve the env
56+
```bash
57+
$ conda activate mamba-env
58+
$ mamba env create -n mesh-tutorial --file tutorial_conda_env.yml
59+
```
60+
* test that this actually _works_, by running all the notebooks
8361

84-
```bash
85-
$ conda activate ssstack-env
86-
$ ssstack shareable temp_condalist_explicit.txt >tutorial_conda_env_resolved.lockfile
87-
$ rm temp_condalist_explicit.txt
88-
```
89-
62+
63+
**Step 2:** make a new version of the lockfile
64+
65+
* use a conda env with 'ssstack' in it (https://github.com/MetOffice/ssstack)
66+
* snapshot the new env content, and replace web-proxy urls to convert it to a "shareable" lockfile
67+
```bash
68+
$ conda activate ssstack-env
69+
$ conda list -n mesh-tutorial --explicit >temp_condalist_explicit.txt
70+
$ ssstack shareable temp_condalist_explicit.txt >tutorial_conda_env_resolved.lock
71+
$ rm temp_condalist_explicit.txt
72+
```
73+
74+
75+
**Step 3:** upload changes in a PR

tutorial_conda_env.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies:
55
- python=3.9
66
- iris
77
- geovista
8-
- vtk=9.2.2 # experiencing segfaults with latest version
8+
- vtk
99
- jupyterlab
1010
- ipyvtklink
1111
- jupytext=1.14.4 # changing version can cause notebook merge conflicts

0 commit comments

Comments
 (0)