Skip to content

Commit

Permalink
Merge branch 'dev' into features/update_documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
birgits committed Jul 24, 2024
2 parents 656ddd0 + d0bb7f6 commit d473a9f
Show file tree
Hide file tree
Showing 36 changed files with 360 additions and 1,741 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/tests-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ jobs:
include:
- name-suffix: "coverage"
os: ubuntu-latest
python-version: 3.8
python-version: 3.9
- name-suffix: "basic"
os: ubuntu-latest
python-version: 3.9
python-version: "3.10"
- name-suffix: "basic"
os: ubuntu-latest
python-version: 3.11
- name-suffix: "basic"
os: windows-latest
python-version: 3.8
python-version: 3.9

steps:
- name: Checkout repo
Expand All @@ -38,7 +41,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Set up julia
if: runner.os == 'Linux' && matrix.python-version == 3.8 && matrix.name-suffix == 'coverage'
if: runner.os == 'Linux'
uses: julia-actions/setup-julia@v1
with:
version: "1.6"
Expand All @@ -58,14 +61,20 @@ jobs:
environment-file: eDisGo_env_dev.yml
python-version: ${{ matrix.python-version }}

- name: Run tests
if: ${{ !(runner.os == 'Linux' && matrix.python-version == 3.8 && matrix.name-suffix == 'coverage') }}
- name: Run tests Linux
if: runner.os == 'Linux' && matrix.name-suffix != 'coverage'
run: |
python -m pip install pytest pytest-notebook
python -m pytest --runslow --runonlinux --disable-warnings --color=yes -v
- name: Run tests Windows
if: runner.os == 'Windows'
run: |
python -m pip install pytest pytest-notebook
python -m pytest --runslow --disable-warnings --color=yes -v
- name: Run tests, coverage and send to coveralls
if: runner.os == 'Linux' && matrix.python-version == 3.8 && matrix.name-suffix == 'coverage'
if: runner.os == 'Linux' && matrix.python-version == 3.9 && matrix.name-suffix == 'coverage'
run: |
pip install pytest pytest-notebook coveralls
coverage run --source=edisgo -m pytest --runslow --runonlinux --disable-warnings --color=yes -v
Expand Down
15 changes: 10 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@
]
# Files to ignore when building api documentation
autoapi_ignore = [
"*/flex_opt/curtailment.py",
"*/flex_opt/storage_positioning.py",
"*/opf/timeseries_reduction.py",
"*/opf/opf_solutions/*",
]
Expand Down Expand Up @@ -128,16 +126,23 @@ def setup(sphinx):
"shapely.%s",
),
"ding0": ("https://dingo.readthedocs.io/en/dev/api/ding0.html#%s", "ding0.%s"),
"pypsa": ("https://pypsa.readthedocs.io/en/latest/components.html#%s", "pypsa.%s"),
"pypsa": (
"https://pypsa.readthedocs.io/en/latest/user-guide/components.html#%s",
"pypsa.%s",
),
"plotly": (
"https://plotly.com/python-api-reference/generated/%s.html",
"plotly.%s",
),
}
# ignore the following external links when checking the links
# stackoverflow is listed here because for some reason the link check fails for these
# stackoverflow and gurobi is listed here because for some reason
# the link check fails for these
# in the github action, even though the link is correct
linkcheck_ignore = [r"https://stackoverflow.com*"]
linkcheck_ignore = [
r"https://stackoverflow.com*",
r"https://support.gurobi.com/*",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down
5 changes: 2 additions & 3 deletions doc/dev_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@ Installation using Linux
~~~~~~~~~~~~~~~~~~~~~~~~

To set up a source installation using linux simply use a virtual environment and install
the source code with pip. Make sure to use python3.7 or higher (recommended
python3.8). **After** setting up your virtual environment and activating it run the
the source code with pip. Make sure to use python3.9 or higher. **After** setting up your virtual environment and activating it run the
following commands within your eDisGo directory:

.. code-block:: bash
python -m pip install -e .[full] # install eDisGo from source
python -m pip install -e .[dev] # install eDisGo from source
pre-commit install # install pre-commit hooks
Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The toolbox currently includes:

* `ding0 <https://github.com/openego/ding0>`_ tool for synthetic medium and low
voltage grid topologies for the whole of Germany
* `OpenEnergy DataBase (oedb) <https://openenergy-platform.org/dataedit/schemas>`_ for
* `OpenEnergy DataBase (oedb) <https://openenergyplatform.org/dataedit/schemas>`_ for
feed-in time series of fluctuating renewables and scenarios for future
power plant park of Germany
* `demandlib <https://github.com/oemof/demandlib>`_ for electrical load time series
Expand Down
122 changes: 16 additions & 106 deletions doc/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
Getting started
================

.. warning:: Make sure to use python 3.9 or higher!

Installation using Linux
-------------------------

.. warning:: Make sure to use python 3.8 or higher!

Install latest eDisGo version through pip. Therefore, we highly recommend using
a virtual environment and its pip.

Expand All @@ -21,8 +21,6 @@ You may also consider installing a developer version as detailed in
Installation using Windows
--------------------------

.. warning:: Make sure to use python 3.8 or higher!

For Windows users we recommend using Anaconda and to install the geo stack
using the conda-forge channel prior to installing eDisGo. You may use the provided
`eDisGo_env.yml file <https://github.com/openego/eDisGo/blob/dev/eDisGo_env.yml>`_
Expand All @@ -44,117 +42,29 @@ Installation using MacOS
We don't have any experience with our package on MacOS yet! If you try eDisGo on MacOS
we would be happy if you let us know about your experience!

Requirements for edisgoOPF package
----------------------------------

.. warning:: The non-linear optimal power flow is currently not maintained and might not work out of the box!

To use the multiperiod optimal power flow that is provided in the julia package
edisgoOPF in eDisGo you additionally need to install julia version 1.1.1.
Download julia from
`julia download page <https://julialang.org/downloads/oldreleases/>`_ and
add it to your path (see
`platform specific instructions <https://julialang.org/downloads/platform/>`_
for more information).

Before using the edisgoOPF julia package for the first time you need to
instantiate it. Therefore, in a terminal change directory to the edisgoOPF
package located in eDisGo/edisgo/opf/edisgoOPF and call julia from there.
Change to package mode by typing

.. code-block:: bash
]
Then activate the package:

.. code-block:: bash
(v1.0) pkg> activate .
And finally instantiate it:

.. code-block:: bash
(SomeProject) pkg> instantiate
.. _prerequisites:

Additional linear solver
^^^^^^^^^^^^^^^^^^^^^^^^^

As with the default linear solver in Ipopt (local solver used in the OPF)
the limit for prolem sizes is reached quite quickly, you may want to instead use
the solver HSL_MA97.
The steps required to set up HSL are also described in the
`Ipopt Documentation <https://coin-or.github.io/Ipopt/INSTALL.html#DOWNLOAD_HSL>`_.
Here is a short version for reference:

First, you need to obtain an academic license for HSL Solvers.
Under https://licences.stfc.ac.uk/product/coin-hsl download the sources for Coin-HSL Full (Stable).
You will need to provide an institutional e-mail to gain access.

Unpack the tar.gz:
Additional requirements for Optimal Power Flow
---------------------------------------------------

.. code-block:: bash
tar -xvzf coinhsl-2014.01.10.tar.gz
To install the solver, clone the Ipopt Third Party HSL tools:

.. code-block:: bash
git clone https://github.com/coin-or-tools/ThirdParty-HSL.git
cd ThirdParty-HSL
Under `ThirdParty-HSL`, create a folder for the HSL sources named `coinhsl` and
copy the contents of the HSL archive into it.
Under Ubuntu, you'll need BLAS, LAPACK and GCC for Fortran. If you don't have them, install them via:

.. code-block:: bash
sudo apt-get install libblas-dev liblapack-dev gfortran
In order to use the optimal power flow, you additionally need:

You can then configure and install your HSL Solvers:
1. **Julia**: Version 1.6.7 is required.
2. **Gurobi Optimizer**: A powerful optimization solver.

.. code-block:: bash
./configure
make
sudo make install
To make Ipopt pick up the solver, you need to add it to your path.
During install, there will be an output that tells you where the libraries have
been put. Usually like this:
Installation Steps
^^^^^^^^^^^^^^^^^^^

.. code-block:: bash
Libraries have been installed in:
/usr/local/lib
1. Install Julia 1.6.7


Add this path to the variable `LD_LIBRARY_PATH`:
Download Julia 1.6.7 from the `Julia LTS releases page <https://julialang.org/downloads/#long_term_support_release>`_.

.. code-block:: bash
export LD_LIBRARY="/usr/local/bin":$LD_LIBRARY_PATH
You might also want to add this to your .bashrc to make it persistent.

For some reason, Ipopt looks for a library named `libhsl.so`, which is not what
the file is named, so we'll also need to provide a symlink:

.. code-block:: bash
Install Julia by following the instructions in the `Julia installation guide <https://julialang.org/downloads/platform/#linux_and_freebsd>`_. Make sure to add Julia to your system path.

cd /usr/local/lib
ln -s libcoinhsl.so libhsl.so

MA97 should now work and can be called from Julia with:
2. Install Gurobi

.. code-block:: julia

JuMP.setsolver(pm.model,IpoptSolver(linear_solver="ma97"))
Follow the `Gurobi installation guide <https://support.gurobi.com/hc/en-us/articles/14799677517585-Getting-Started-with-Gurobi-Optimizer>`_ to install Gurobi and add it to your system path.

Prerequisites
-------------
Expand Down Expand Up @@ -188,8 +98,8 @@ Aside from grid topology data you may eventually need a dataset on future
installation of power plants. You may therefore use the scenarios developed in
the `open_eGo <https://openegoproject.wordpress.com>`_ project that
are available in the
`OpenEnergy DataBase (oedb) <https://openenergy-platform.org/dataedit/schemas>`_
hosted on the `OpenEnergy Platform (OEP) <https://openenergy-platform.org/>`_.
`OpenEnergy DataBase (oedb) <https://openenergyplatform.org/dataedit/schemas>`_
hosted on the `OpenEnergy Platform (OEP) <https://openenergyplatform.org/>`_.
eDisGo provides an interface to the oedb using the package
`ego.io <https://github.com/openego/ego.io>`_. ego.io gives you a python
SQL-Alchemy representations of the oedb and access to it by using the
Expand Down
2 changes: 1 addition & 1 deletion doc/usage_details.rst
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ This mode can be invoked as follows:
For the following components you can use existing time series:

* Fluctuating generators: Feed-in time series for solar and wind power plants can be
retrieved from the `OpenEnergy DataBase <https://openenergy-platform.org/dataedit/schemas>`_.
retrieved from the `OpenEnergy DataBase <https://openenergyplatform.org/dataedit/schemas>`_.
* Conventional loads: Standard load profiles for the different sectors residential,
commercial, agricultural and industrial are generated using the oemof
`demandlib <https://github.com/oemof/demandlib/>`_.
Expand Down
4 changes: 2 additions & 2 deletions eDisGo_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python >= 3.8, < 3.10
- python >= 3.9, <= 3.11
- pip
- pandas >= 1.4, < 2.2.0
- conda-forge::fiona
Expand All @@ -16,6 +16,6 @@ dependencies:
- conda-forge::pygeos
- conda-forge::contextily
- conda-forge::descartes
- conda-forge::pypsa >= 0.17.0, <= 0.20.1
- conda-forge::pypsa == 0.26.2
- pip:
- eDisGo
4 changes: 2 additions & 2 deletions eDisGo_env_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python >= 3.8, < 3.10
- python >= 3.9, <= 3.11
- pip
- pandas >= 1.4, < 2.2.0
- conda-forge::fiona
Expand All @@ -16,6 +16,6 @@ dependencies:
- conda-forge::pygeos
- conda-forge::contextily
- conda-forge::descartes
- conda-forge::pypsa >= 0.17.0, <= 0.20.1
- conda-forge::pypsa == 0.26.2
- pip:
- -e .[dev]
Loading

0 comments on commit d473a9f

Please sign in to comment.