|
1 | | -# Getting started |
| 1 | +# Getting started |
2 | 2 |
|
3 | 3 |
|
4 | 4 | ## What is `heiplanet-models` all about? |
5 | 5 | This package bundles the model implementation for the [heiplanet project](TODO) and provides a development platform for their maintenance and extension as well as the addition of new model code. |
6 | | -All models are implemented in Python using xarray, geopandas, and numpy, but additional dependencies can be added as needed. |
| 6 | +All models are implemented in Python using xarray, geopandas, and numpy, but additional dependencies can be added as needed. |
7 | 7 |
|
8 | 8 |
|
9 | 9 | ## Installation |
10 | | -If you want to use the models that exist in `heiplanet-models`, execute the following steps to install the package: |
| 10 | +If you want to use the models that exist in `heiplanet-models`, execute the following steps to install the package: |
11 | 11 |
|
12 | | -- Make a new virtual environment, e.g., with python `venv`: |
| 12 | +- Make a new virtual environment, e.g., with python `venv`: |
13 | 13 | ```bash |
14 | | -python -m venv venv |
| 14 | +python -m venv venv |
15 | 15 | ``` |
16 | | -In this case, the new environment will be called `venv`. This can then be activated with: |
| 16 | +In this case, the new environment will be called `venv`. This can then be activated with: |
17 | 17 |
|
18 | | -```bash |
19 | | -source ./venv/bin/activate |
20 | | -``` |
21 | | -Virtual environment are a great way to bundle the dependencies of a project, e.g., `heiplanet-models` in one place without polluting your system's python distribution or intefering with dependencies of other projects. With virtual environments, you can have an arbitrary number of isolated projects running alongside each other without interference. |
| 18 | +```bash |
| 19 | +source ./venv/bin/activate |
| 20 | +``` |
| 21 | +Virtual environment are a great way to bundle the dependencies of a project, e.g., `heiplanet-models` in one place without polluting your system's python distribution or intefering with dependencies of other projects. With virtual environments, you can have an arbitrary number of isolated projects running alongside each other without interference. |
22 | 22 |
|
23 | 23 |
|
24 | | -- Install the package: |
25 | | -To get the current release, after activating the virtual environment, type: |
| 24 | +- Install the package: |
| 25 | +To get the current release, after activating the virtual environment, type: |
26 | 26 |
|
27 | | -```bash |
| 27 | +```bash |
28 | 28 | python -m pip install heiplanet-models |
29 | 29 | ``` |
30 | | -This will pull in the package and all its basic dependencies. |
| 30 | +This will pull in the package and all its basic dependencies. |
31 | 31 |
|
32 | 32 |
|
33 | 33 | ## Installation for development |
34 | | -The steps for creating and activating a virtual environment stay the same. Execute those first. Then: |
| 34 | +The steps for creating and activating a virtual environment stay the same. Execute those first. Then: |
35 | 35 |
|
36 | | -- Download the repository |
| 36 | +- Download the repository |
37 | 37 |
|
38 | 38 | ```bash |
39 | | -git clone https://github.com/ssciwr/onehealth-model-backend.git |
| 39 | +git clone https://github.com/ssciwr/heiplanet-models.git |
40 | 40 | ``` |
41 | 41 |
|
42 | | -- After creating and activating a new virtual environment, go to the base directory of the repository, and run |
| 42 | +- After creating and activating a new virtual environment, go to the base directory of the repository, and run |
43 | 43 |
|
44 | 44 | ```bash |
45 | 45 | pip install -e .[dev,docs] |
46 | 46 | ``` |
47 | 47 | This will install the version of the code on the current `main` branch in `editable` mode, such that changes you make are immediatelly reflected in the importable package. It will also add additional dependencies for unit-testing and for building the documentation. |
48 | 48 |
|
49 | | -In order to be able to visualize the computational graphs of the models you use or build, you need to install the package with the `viz` option. This will install the graphviz package which will take care of the visualization. |
| 49 | +In order to be able to visualize the computational graphs of the models you use or build, you need to install the package with the `viz` option. This will install the graphviz package which will take care of the visualization. |
50 | 50 |
|
51 | 51 | ```bash |
52 | 52 | pip install .[viz] |
53 | 53 | ``` |
54 | | -or, on macos: |
| 54 | +or, on macos: |
55 | 55 |
|
56 | 56 | ```bash |
57 | 57 | pip install ".[viz]" |
58 | 58 | ``` |
59 | | -Graphviz itself has additional dependencies it needs to install. For more details, see [here](https://github.com/xflr6/graphviz?tab=readme-ov-file#installation). |
| 59 | +Graphviz itself has additional dependencies it needs to install. For more details, see [here](https://github.com/xflr6/graphviz?tab=readme-ov-file#installation). |
60 | 60 |
|
61 | 61 |
|
62 | | -## Building the documentation |
63 | | -If you want to build the documentation locally, you need to clone the repostiroy as explained above and have to install the package with the `docs` option. Then, from the root directory of the repository, execute |
64 | | -```bash |
65 | | -mkdocs serve |
| 62 | +## Building the documentation |
| 63 | +If you want to build the documentation locally, you need to clone the repostiroy as explained above and have to install the package with the `docs` option. Then, from the root directory of the repository, execute |
| 64 | +```bash |
| 65 | +mkdocs serve |
66 | 66 | ``` |
67 | 67 |
|
68 | | -the output should contain a line similar to this: |
| 68 | +the output should contain a line similar to this: |
69 | 69 |
|
70 | | -```bash |
| 70 | +```bash |
71 | 71 | INFO - [12:51:53] Browser connected: http://127.0.0.1:8000/api/ |
72 | 72 | ``` |
73 | 73 |
|
74 | | -which is a local URL under which the documentation can be viewed in your browser. |
| 74 | +which is a local URL under which the documentation can be viewed in your browser. |
0 commit comments