Skip to content

Commit

Permalink
Merge pull request #423 from davide-f/fix_dependency_ppl
Browse files Browse the repository at this point in the history
Add java dependency to documentation
  • Loading branch information
davide-f committed Aug 3, 2022
2 parents 15a8385 + b8b88ac commit 4fad0ce
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 21 deletions.
42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,45 @@ There are multiple ways to get involved and learn more about our work. That's ho

1. Open your terminal at a location where you want to install pypsa-africa. Type the following in your terminal to download the package from GitHub:

```bash
.../some/path/without/spaces % git clone https://github.com/pypsa-meets-africa/pypsa-africa.git
```
```bash
.../some/path/without/spaces % git clone https://github.com/pypsa-meets-africa/pypsa-africa.git
```

2. The python package requirements are curated in the `envs/environment.yaml` file.
The environment can be installed using:

```bash
.../pypsa-africa % conda env create -f envs/environment.yaml
```
```bash
.../pypsa-africa % conda env create -f envs/environment.yaml
```
For faster installation you might want to try mamba
```bash
(base) conda install -c conda-forge mamba
.../pypsa-africa % mamba env create -f envs/environment.yaml
```
```bash
(base) conda install -c conda-forge mamba
.../pypsa-africa % mamba env create -f envs/environment.yaml
```

3. For running the optimization one has to install the solver. We can recommend the open source HiGHs solver which installation manual is given [here](https://github.com/PyPSA/PyPSA/blob/633669d3f940ea256fb0a2313c7a499cbe0122a5/pypsa/linopt.py#L608-L632).

4. To use jupyter lab (new jupyter notebooks) **continue** with the [ipython kernel installation](http://echrislynch.com/2019/02/01/adding-an-environment-to-jupyter-notebooks/) and test if your jupyter lab works:

```bash
.../pypsa-africa % ipython kernel install --user --name=pypsa-africa
```bash
.../pypsa-africa % ipython kernel install --user --name=pypsa-africa
.../pypsa-africa % jupyter lab
```

.../pypsa-africa % jupyter lab
```
5. Verify or install a java redistribution from the [official website](https://www.oracle.com/java/technologies/downloads/) or equivalent.
To verify the successfull installation the following code can be tested from bash:

```bash
.../pypsa-africa % java -version
```

The expected output should resemble the following:

```bash
java version "1.8.0_341"
Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)
```

## Test run on tutorial

Expand Down
35 changes: 29 additions & 6 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ The complete list of software needed before installing PyPSA Africa is listed be
- `Git <https://git-scm.com/>`__ **(mandatory)**: Git is a free open source system aimed at tracking changes in the code development
and enable to coordinate the parallel software development between many developers.
It is mandatory to `learn the git basics <https://git-scm.com/doc>`_.
- `Java <https://www.oracle.com/java/technologies/downloads/>`_ **(recommendation)**: A Java distribution is needed for using `powerplantmatching` package.
To have a better user experience, please install the redistribution from the website according to your operating system.
- `IDE Python` **(recommendation)**: in order to write python code, you need an Integrated Development Environment (IDE)
that is a software used to write code. Any program can be used, however, we recommend `Visual Studio Code <https://code.visualstudio.com/>`_,
which is freely available online.
Expand Down Expand Up @@ -112,15 +114,36 @@ and test if your jupyter lab works:
.../pypsa-africa % jupyter lab
.. note::
``Snakemake``, which is one of the major dependencies, will be automatically installed in the environment pypsa-africa,
thereby there is no need to install it manually.
The snakemake included in the conda environment pypsa-africa installed with the above-mentioned procedure can be executed with the following procedure:
Please, make sure to have properly installed java, from the `official website <https://www.oracle.com/java/technologies/downloads/>`__ or equivalent.

.. code: bash
In linux only, that is possible through the following command.

.../pypsa-africa % .../pypsa-africa % conda activate pypsa-africa
.. code: bash
.../pypsa-africa % snakemake < any command here >
.../pypsa-africa % .../pypsa-africa % conda activate pypsa-africa
.../pypsa-africa % conda install -c conda-forge openjdk
To verify the successful installation, you can verify that by using the following code.
.. code: bash
.../pypsa-africa % java -version
The expected output should resemble the following text:
.. code: bash
java version "1.8.0_341"
Java(TM) SE Runtime Environment (build 1.8.0_341-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)
.. note::
``Snakemake``, which is one of the major dependencies, will be automatically installed in the environment pypsa-africa,
thereby there is no need to install it manually.
The snakemake included in the conda environment pypsa-africa installed with the above-mentioned procedure can be executed with the following procedure:

.. code: bash
.../pypsa-africa % .../pypsa-africa % conda activate pypsa-africa
.../pypsa-africa % snakemake < any command here >
Download data
Expand Down
2 changes: 1 addition & 1 deletion doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Upcoming Release

* Implement PyPSA-Eur improvements. Add gas limit constraints, add marginal cost sweeps wildcard, add and harmonize aggregation strategies, improve config usability by carrier clarifications, ease debugging by removing snakemake inputs from functions: `PR #402 <https://github.com/pypsa-meets-africa/pypsa-africa/pull/402>`_

* Fix and add docs. Fix incomplete tutorial, recommend mamba for installation, add YouTube videos: `PR #412 <https://github.com/pypsa-meets-africa/pypsa-africa/pull/412>`_
* Fix and add docs. Fix incomplete tutorial, recommend mamba for installation, add YouTube videos `PR #412 <https://github.com/pypsa-meets-africa/pypsa-africa/pull/412>`_ and `PR #423 <https://github.com/pypsa-meets-africa/pypsa-africa/pull/423>`_

* Restructure the package to ease readability and fix google drive downloading method: `PR #355 <https://github.com/pypsa-meets-africa/pypsa-africa/pull/355>`__

Expand Down

0 comments on commit 4fad0ce

Please sign in to comment.