You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-13Lines changed: 38 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,35 +26,61 @@ The `CABE_` variables are defined in the `.env` file.
26
26
See [.env.example](.env.example) file for an example.
27
27
To run the application the `.env` file is required.
28
28
29
-
## API service
30
-
31
-
The API web service reads the NetCDF file and returns the data as JSON which is used in the web application.
29
+
## Software requirements
32
30
33
-
It is written in Python using [Flask](https://flask.palletsprojects.com/)and [xarray](https://xarray.dev/).
31
+
You should have [Node.js](https://nodejs.org/en) (v22 or greater) and Python 3.12 installed.
34
32
35
-
Python dependencies can be installed with
33
+
Dependencies can be installed with
36
34
37
35
```bash
38
-
python3 -m venv venv
39
-
source venv/bin/activate
36
+
# From the root of the repository
37
+
# To install Node.js dependencies
38
+
npm install
39
+
# To install Python dependencies
40
40
pip install -r requirements.txt
41
41
```
42
42
43
-
The web service can be started with
43
+
## Software installation on Windows
44
+
45
+
Use miniforge to setup Python and Node.js.
46
+
47
+
1. From [https://conda-forge.org/download](https://conda-forge.org/download/) download the latest Miniforge3 Windows 64-bit installer and install it.
48
+
2. Open a PowerShell
49
+
3. Create environment with `mamba create --name cabe python=3.12 nodejs=22`
50
+
4. Activate environment with `mamba activate cabe`
51
+
5. Change the current working directory to the location where you want to clone the repository. For example `cd C:\Users\username\Documents`.
52
+
6. Clone repo with `git clone https://github.com/pbl-nl/website-carbon-budget-explorer.git` or use [Visual Studio Code](https://code.visualstudio.com/) to clone repository.
53
+
7. Change the current working directory to the repository with `cd website-carbon-budget-explorer`.
54
+
8. Install Python dependencies with `pip install -r requirements.txt`
55
+
9. Install Node.js dependencies with `npm install`
56
+
57
+
If `git` executable is not installed, then install with `mamba install git`.
58
+
59
+
If `mamba` executable is not available, use `conda` instead.
60
+
61
+
Do not forget to activate the environment with `mamba activate cabe` before running the commands below.
62
+
63
+
## API service
64
+
65
+
The API web service reads the NetCDF files and returns the data as JSON which is used in the web application.
66
+
67
+
It is written in Python using [Flask](https://flask.palletsprojects.com/) and [xarray](https://xarray.dev/).
68
+
69
+
On Linux and MacOS the web service can be started with
44
70
45
71
```bash
46
72
gunicorn --bind 0.0.0.0:5000 --workers 4 'ws:app'
47
73
```
48
74
49
75
(Add `--reload` argumment to reload on Python file changes)
50
76
51
-
In Windows gunicorn might not work. Then use waitress.
77
+
On Windows, use flask built-in developer server.
52
78
53
79
```shell
54
-
pip install waitress
55
-
waitress-serve --listen=127.0.0.1:5000 ws:app
80
+
flask --app ws:app run -p 5000
56
81
```
57
82
83
+
If an error occurs here, try out different ports (e.g. 5001, 5005 etc). Also adjust the changed port in the `.env` file.
<pclass="italic">The remaining emissions are determined by:</p>
57
57
<divclass="block">
58
58
Limit global warming to (°C)
59
59
<span
60
60
class="tooltip text-lg"
61
61
data-tip="The peak temperature target determines the emissions we can globally still emit. A
62
-
less ambitious target (for example, 2.2°C) implies the possibility to emit more greenhouse gases."
62
+
less ambitious target (for example, 2.2°C) implies the possibility to emit more greenhouse gases."
63
63
>ⓘ</span
64
64
>
65
65
<CustomRange
@@ -86,9 +86,9 @@
86
86
Reduction of non-CO<sub>2</sub> emissions
87
87
<span
88
88
class="tooltip z-[750] text-lg"
89
-
data-tip="Not only CO2, but also other gases play a role in the global emissions trajectory. Setting this slider to low values assumes small reductions in non-CO2 by 2040, which means that CO2 has to reduce much more, and vica versa.
90
-
In the graph to the right, we show all greenhouse gases (CO2 and non-CO2), so the green line will barely move if you adjust this slider, as the temperature goal remains fixed.
91
-
However, this does greatly affect the carbon budget (which is only the CO2 part) in the top-left corner of your screen."
89
+
data-tip="Not only CO₂, but also other gases play a role in the global emissions trajectory. Setting this slider to low values assumes small reductions in non-CO₂ by 2040, which means that CO₂ has to reduce much more, and vica versa.
90
+
In the graph to the right, we show all greenhouse gases (CO₂ and non-CO₂), so the green line will barely move if you adjust this slider, as the temperature goal remains fixed.
91
+
However, this does greatly affect the carbon budget (which is only the CO₂ part) in the top-left corner of your screen."
<p><i>How do we spend these emissions over time?</i></p>
100
+
<p><i>The allocation of these emissions over time is determined by:</i></p>
102
101
<divclass="block">
103
102
End-of-century negative emissions
104
103
<span
@@ -114,10 +113,10 @@
114
113
/>
115
114
</div>
116
115
<div>
117
-
The timing of early-century mitigation
116
+
Timing of early-century mitigation
118
117
<span
119
118
class="tooltip text-lg"
120
-
data-tip="Analogous to IPCC WGIII scenarios, we distinguish global emission pathways with delayed (i.e., near-similar emissions up to 2030) and immediate action. Delayed action is infeasible with a temperature target of 1.5, so identical data will be shown in that case."
119
+
data-tip="Analogous to IPCC WGIII scenarios, we distinguish global emission pathways with delayed (i.e., near-similar emissions up to 2030) and immediate action. Delayed action is infeasible with a temperature target of 1.5 °C, so identical data will be shown in that case."
0 commit comments