Skip to content

Commit

Permalink
Merge branch 'dev' into features/n-minus-one-security
Browse files Browse the repository at this point in the history
  • Loading branch information
birgits committed Sep 13, 2024
2 parents 0b3f1f9 + 751004e commit fdaacaf
Show file tree
Hide file tree
Showing 58 changed files with 1,944 additions and 2,204 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
18 changes: 14 additions & 4 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 @@ -116,7 +114,7 @@ def setup(sphinx):
"networkx.%s",
),
"sqlalchemy": (
"http://docs.sqlalchemy.org/en/latest/core/connections.html#%s",
"https://docs.sqlalchemy.org/en/latest/core/connections.html#%s",
"sqlalchemy.%s",
),
"numpy": (
Expand All @@ -128,12 +126,24 @@ 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 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*",
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
124 changes: 17 additions & 107 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://www.hsl.rl.ac.uk/ipopt/ 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 All @@ -163,7 +73,7 @@ Beyond a running and up-to-date installation of eDisGo you need **grid topology
data**. Currently synthetic grid data generated with the python project
`Ding0 <https://github.com/openego/ding0>`_
is the only supported data source. You can retrieve data from
`Zenodo <https://zenodo.org/record/890479>`_
`Zenodo <https://zenodo.org/records/890479>`_
(make sure you choose latest data) or check out the
`Ding0 documentation <https://dingo.readthedocs.io/en/dev/usage_details.html#ding0-examples>`_
on how to generate grids yourself.
Expand All @@ -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
2 changes: 2 additions & 0 deletions doc/whatsnew/v0-3-0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ Changes
* Added method to aggregate LV grid buses to station bus secondary side `#353 <https://github.com/openego/eDisGo/pull/353>`_
* Adapted codebase to work with pandas 2.0 `#373 <https://github.com/openego/eDisGo/pull/373>`_
* Added option to run reinforcement with reduced number of time steps `#379 <https://github.com/openego/eDisGo/pull/379>`_
(adapted in `#395 <https://github.com/openego/eDisGo/pull/395>`_)
* Added optimization method to determine dispatch of flexibilities that lead to minimal network expansion costs `#376 <https://github.com/openego/eDisGo/pull/376>`_
* Added a new reinforcement method that separate lv grids when the overloading is very high `#380 <https://github.com/openego/eDisGo/pull/380>`_
* Move function to assign feeder to Topology class and add methods to the Grid class to get information on the feeders `#360 <https://github.com/openego/eDisGo/pull/360>`_
* Added a storage operation strategy where the storage is charged when PV feed-in is higher than electricity demand of the household and discharged when electricity demand exceeds PV generation `#386 <https://github.com/openego/eDisGo/pull/386>`_
* Added an estimation of the voltage deviation over a cable when selecting a suitable cable to connect a new component `#411 <https://github.com/openego/eDisGo/pull/411>`_
6 changes: 3 additions & 3 deletions eDisGo_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ channels:
- conda-forge
- defaults
dependencies:
- python >= 3.8, < 3.10
- python >= 3.9, <= 3.11
- pip
- pandas >= 1.4
- pandas >= 1.4, < 2.2.0
- conda-forge::fiona
- conda-forge::geopy
- conda-forge::geopandas
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
6 changes: 3 additions & 3 deletions eDisGo_env_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ channels:
- conda-forge
- defaults
dependencies:
- python >= 3.8, < 3.10
- python >= 3.9, <= 3.11
- pip
- pandas >= 1.4
- pandas >= 1.4, < 2.2.0
- conda-forge::fiona
- conda-forge::geopy
- conda-forge::geopandas
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]
5 changes: 5 additions & 0 deletions edisgo/config/config_grid_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ upper_limit_voltage_level_6 = 0.2
upper_limit_voltage_level_5 = 5.5
upper_limit_voltage_level_4 = 20.0

# from VDE-AR-N 4100 (VDE-AR-N 4100) Anwendungsregel: 2019-04, table 3
lv_max_voltage_deviation = 0.03
# from VDE-AR-N 4110 (VDE-AR-N 4110) Anwendungsregel: 2023-09, 5.3.2 Zulässige Spannungsänderung
mv_max_voltage_deviation = 0.02

[disconnecting_point]

# Positioning of disconnecting points: Can be position at location of most
Expand Down
Loading

0 comments on commit fdaacaf

Please sign in to comment.