Skip to content
Snippets Groups Projects
Commit 178becae authored by Sebastian Schubert's avatar Sebastian Schubert
Browse files

Update first steps on COLAB documentation

parent 47575b15
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
# Run the Carbon Cycle Assessment
In order to run the Carbon Cycle Assessment (CCA), you need to get the model code first. This code is available TU's git server. [git is a version control system](https://git-scm.com/book/de/v2) and helps to keep track of everything that resembles code. Is is integrated in many development environments such as [Visual Studio Code](https://code.visualstudio.com/docs/sourcecontrol/overview) and can be [run from the command line](https://git-scm.com/book/de/v2)). It also helps to collaborate.
Run the following to clone the repository (i.e. create a local copy) to the Colab environment and to change into the directory (`cd`) of the code:
%% Cell type:markdown id: tags:
Run the following to clone the repository (i.e. create a local copy) to the Colab environment and to change into the directory (`cd`) of the code. Necessary python extensions are installed with `pip`:
%% Cell type:code id: tags:
``` python
!git clone https://git.tu-berlin.de/sebschub/tests.git
%cd tests
!git clone https://git.tu-berlin.de/urbanoikos/models/cca.git
%cd /content/cca
!pip install -r requirements.txt
```
%% Cell type:markdown id: tags:
The repository does not only include the code but also the data that is needed to run the model. Have a look into the `Files` (`Dateien`) section on the left of the Colab screen. The `cca` folder includes the `cca` python package in the `cca` subfolder and the input data for the Tegel application in the `applications/Tegel` folder.
First, load the cca package:
%% Cell type:code id: tags:
``` python
import cca
```
%% Cell type:markdown id: tags:
In order to read in the Tegel data, process it and produce the output, run the following:
%% Cell type:code id: tags:
``` python
tegel = cca.cca_to_df(
filepath_minfotable="materialinfo.ods",
filepath_musagetable="materialusage.ods",
infra_floor_area=1276.429,
filepath_minfotable="applications/tegel/materialinfo.ods",
filepath_musagetable="applications/tegel/materialusage.ods",
infra_floor_area=5105.716, # = 4 times the base area (1276.429m²) as building have 4 levels
project_area=213069.25,
)
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment