|
1 | 1 | ISIMIP3 simulation protocol |
2 | 2 | =========================== |
3 | 3 |
|
4 | | -This project builds sector-specific ISIMIP protocols from a common data source. |
5 | | -Machine-readable data are under [definitions](definitions/), and text under [protocol](protocol/). |
6 | | - |
7 | | -The rendered protocols are found at https://protocol.isimip.org. |
| 4 | +This repository contains all information and tools to build the ISIMIP3 protocol as presented on [protocol.isimip.org](https://protocol.isimip.org). The YAML files containing the information for the tables are located under [definitions](definitions/) and the markdown files for the text under [protocol](protocol/). |
8 | 5 |
|
9 | 6 | You can clone this repository and work and render the files locally as documented below. |
10 | 7 |
|
11 | | -You can also edit the markdown files at github directly. With a delay of minutes, |
12 | | -your updates will be visible at `https://protocol.isimip.org`. |
| 8 | +You can also edit the markdown files at github directly. With a delay of minutes, your updates will be visible at `https://protocol.isimip.org`. |
| 9 | + |
| 10 | +As a rule, the sector-specific text should be kept to a minimum and cover as much structure as possible by machine-readable code under [definitions](definitions/). |
13 | 11 |
|
14 | | -As a rule, the sector-specific text should be kept to a minimum and cover |
15 | | -as much structure as possible by machine-readable code under [definitions](definitions/). |
16 | 12 |
|
17 | 13 | Setup |
18 | 14 | ----- |
19 | 15 |
|
20 | 16 | Building the protocol requires: |
21 | 17 |
|
22 | | -- **git**: for version control |
23 | | -- **Python** (> 3.6) |
24 | | -- **curl**: for downloading nvm in the app Makefile |
25 | | - |
26 | | -The installation of Python (and its developing packages), however differs from operating system to operating system. Instructions can be found [here](https://github.com/ISI-MIP/isimip-qc/blob/main/README.md#prerequisites). |
| 18 | +- **Python** (> 3.10) |
| 19 | +- **git** for version control |
| 20 | +- **curl** for downloading `nvm` |
27 | 21 |
|
28 | | -A `Makefile` is provided to help with the installation process. |
| 22 | +The installation of Python (and its developing packages) differs from operating system to operating system. Instructions to setup Python for your system can be found [here](https://utils.isimip.org/prerequisites/). |
29 | 23 |
|
30 | | -If you work with different Python applications, we recommend to create a virtual environment for the protocol: |
| 24 | +We recommend to create a virtual environment for the protocol: |
31 | 25 |
|
32 | 26 | ```bash |
33 | 27 | python3 -m venv env |
34 | 28 | source env/bin/activate # the env needs to be sourced everytime you use a new terminal |
35 | 29 | ``` |
36 | 30 |
|
37 | | -The Python requirements are installed using: |
| 31 | +The Python requirements can be installed using: |
38 | 32 |
|
39 | 33 | ```bash |
40 | 34 | pip install -r requirements.txt |
41 | 35 | ``` |
42 | 36 |
|
43 | | -The JavaScript part of the protocol needs to be build using NodeJS and Webpack. For convenience this can be done by using only: |
| 37 | + |
| 38 | +Build |
| 39 | +----- |
| 40 | + |
| 41 | +The different `build` scripts can be run by using: |
44 | 42 |
|
45 | 43 | ```bash |
46 | | -make app |
| 44 | +make |
47 | 45 | ``` |
48 | 46 |
|
49 | | -`make app` bootstraps Node via nvm and requires `curl`. |
| 47 | +The output files are located in `output`. |
50 | 48 |
|
51 | | - |
52 | | -Build |
53 | | ------ |
| 49 | +The JavaScript part of the protocol needs to be build using [NodeJS](https://nodejs.org) and [vite](https://vite.dev/). For convenience this can be done by using ([nvm](https://github.com/nvm-sh/nvm) and the Node dependencies are downloaded automatically, this requires `curl`): |
54 | 50 |
|
55 | 51 | ```bash |
56 | | -make # should work on Linux/macOS |
57 | | -make dev # like make, but lining the front-end assets for development |
58 | | - |
59 | | -make serve # starts a http server on port :8000 so that you can access the protocol in your browser |
| 52 | +make app |
| 53 | +make watch # automatically rebuild when the source changes |
60 | 54 | ``` |
61 | 55 |
|
62 | | -The output files are located in `output`. The files, e.g. `index.html` can opened with a web browser. |
| 56 | +When working with different branches or after dependency changed, the following make targets can be used to clean the local copy: |
| 57 | + |
| 58 | +``` |
| 59 | +make clean # removes the output directory |
| 60 | +make cleannode # removes nvm and node_modules (JavaScript dependencies) |
| 61 | +make cleanenv # removes the virtual environment (Python dependencies) |
| 62 | +make distclean # runs all clean targets |
| 63 | +``` |
63 | 64 |
|
64 | 65 |
|
65 | 66 | Development server |
66 | 67 | ------------------ |
67 | 68 |
|
68 | | -The command `make serve` will open a local webserver on port `:8000`. The protocol can than be accessed at http://localhost:8080 from a browser. |
| 69 | +The command |
| 70 | + |
| 71 | +```bash |
| 72 | +make serve |
| 73 | +``` |
| 74 | + |
| 75 | +will open a local webserver on port `:8080`. The protocol can than be accessed at http://localhost:8080 from a browser. |
69 | 76 |
|
70 | 77 |
|
71 | 78 | Editing |
72 | 79 | ------- |
73 | 80 |
|
74 | | -Edit the markdown files for each sector under [protocol](protocol). |
| 81 | +The textual part of the protocol can be edited using the markdown files in [protocol](protocol). |
75 | 82 |
|
76 | 83 | The interactive tables have the following syntax: |
77 | 84 |
|
@@ -125,7 +132,7 @@ The definition YAML files however can be changed without touching the JavaScript |
125 | 132 | ... |
126 | 133 | ``` |
127 | 134 |
|
128 | | -Here `1850soc` only applies to the givem set of sectors and only to `ISIMIP3b`, while `histsoc` is used both in `ISIMIP3a` and `ISIMIP3b` and in every sector. Some attributes (e.g. `frequency` in `definitions/variable`) can have objects as value, which the are evaluated for the particular sector. |
| 135 | +Here `1850soc` only applies to the given set of sectors and only to `ISIMIP3b`, while `histsoc` is used both in `ISIMIP3a` and `ISIMIP3b` and in every sector. Some attributes (e.g. `frequency` in `definitions/variable`) can have objects as value, which the are evaluated for the particular sector. |
129 | 136 |
|
130 | 137 | In order to add a new sector, the following steps need to be taken: |
131 | 138 |
|
|
0 commit comments