From 591141a74b8ed4435dd8987f50527c417a7537f5 Mon Sep 17 00:00:00 2001 From: Jonas Danke Date: Mon, 8 Jul 2024 11:42:50 +0200 Subject: [PATCH 1/8] Fix docs link check and build issues --- doc/conf.py | 5 ++++- doc/index.rst | 2 +- doc/quickstart.rst | 4 ++-- doc/usage_details.rst | 2 +- edisgo/edisgo.py | 16 ++++++++-------- edisgo/io/dsm_import.py | 2 +- edisgo/io/generators_import.py | 4 ++-- edisgo/io/heat_pump_import.py | 2 +- edisgo/io/timeseries_import.py | 10 +++++----- edisgo/network/heat.py | 8 ++++---- edisgo/network/timeseries.py | 2 +- 11 files changed, 30 insertions(+), 27 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 851a3fb6d..ad1be2546 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -128,7 +128,10 @@ 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", diff --git a/doc/index.rst b/doc/index.rst index dfebb4369..444e35f04 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -15,7 +15,7 @@ The toolbox currently includes: * `ding0 `_ tool for synthetic medium and low voltage grid topologies for the whole of Germany - * `OpenEnergy DataBase (oedb) `_ for + * `OpenEnergy DataBase (oedb) `_ for feed-in time series of fluctuating renewables and scenarios for future power plant park of Germany * `demandlib `_ for electrical load time series diff --git a/doc/quickstart.rst b/doc/quickstart.rst index 4ce437c05..a4af052f7 100644 --- a/doc/quickstart.rst +++ b/doc/quickstart.rst @@ -188,8 +188,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 `_ project that are available in the -`OpenEnergy DataBase (oedb) `_ -hosted on the `OpenEnergy Platform (OEP) `_. +`OpenEnergy DataBase (oedb) `_ +hosted on the `OpenEnergy Platform (OEP) `_. eDisGo provides an interface to the oedb using the package `ego.io `_. ego.io gives you a python SQL-Alchemy representations of the oedb and access to it by using the diff --git a/doc/usage_details.rst b/doc/usage_details.rst index aac09982f..a35ba1e20 100644 --- a/doc/usage_details.rst +++ b/doc/usage_details.rst @@ -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 `_. + retrieved from the `OpenEnergy DataBase `_. * Conventional loads: Standard load profiles for the different sectors residential, commercial, agricultural and industrial are generated using the oemof `demandlib `_. diff --git a/edisgo/edisgo.py b/edisgo/edisgo.py index dca1660b2..52e708b2d 100755 --- a/edisgo/edisgo.py +++ b/edisgo/edisgo.py @@ -417,7 +417,7 @@ def set_time_series_active_power_predefined( Technology- and weather cell-specific hourly feed-in time series are obtained from the `OpenEnergy DataBase - `_. See + `_. See :func:`edisgo.io.timeseries_import.feedin_oedb` for more information. This option requires that the parameter `engine` is provided in case @@ -478,7 +478,7 @@ def set_time_series_active_power_predefined( Sets active power demand time series using individual hourly electricity load time series for one year obtained from the `OpenEnergy DataBase - `_. + `_. This option requires that the parameters `engine` and `scenario` are provided. For further settings, the parameter `timeindex` can also be @@ -933,7 +933,7 @@ def import_generators(self, generator_scenario=None, **kwargs): Gets generator park for specified scenario and integrates generators into grid. The generator data is retrieved from the - `open energy platform `_. Decommissioned + `open energy platform `_. Decommissioned generators are removed from the grid, generators with changed capacity updated and new generators newly integrated into the grid. @@ -1928,7 +1928,7 @@ def import_electromobility( Imports electromobility data and integrates charging points into grid. Electromobility data can be obtained from the `OpenEnergy DataBase - `_ or from self-provided + `_ or from self-provided data. In case you want to use self-provided data, it needs to be generated using the tools `SimBEV `_ (required version: @@ -1960,7 +1960,7 @@ def import_electromobility( * "oedb" Electromobility data is obtained from the `OpenEnergy DataBase - `_. + `_. This option requires that the parameters `scenario` and `engine` are provided. @@ -2143,7 +2143,7 @@ def import_heat_pumps(self, scenario, engine, timeindex=None, import_types=None) between two scenarios: 'eGon2035' and 'eGon100RE'. The data is retrieved from the - `open energy platform `_. + `open energy platform `_. # ToDo Add information on scenarios and from which tables data is retrieved. @@ -2305,7 +2305,7 @@ def apply_heat_pump_operating_strategy( def import_dsm(self, scenario: str, engine: Engine, timeindex=None): """ Gets industrial and CTS DSM profiles from the - `OpenEnergy DataBase `_. + `OpenEnergy DataBase `_. Profiles comprise minimum and maximum load increase in MW as well as maximum energy pre- and postponing in MWh. The data is written to the @@ -2356,7 +2356,7 @@ def import_home_batteries( between two scenarios: 'eGon2035' and 'eGon100RE'. The data is retrieved from the - `open energy platform `_. + `open energy platform `_. The batteries are integrated into the grid (added to :attr:`~.network.topology.Topology.storage_units_df`) based on their building diff --git a/edisgo/io/dsm_import.py b/edisgo/io/dsm_import.py index fac856d9f..648ae5039 100644 --- a/edisgo/io/dsm_import.py +++ b/edisgo/io/dsm_import.py @@ -28,7 +28,7 @@ def oedb( ): """ Gets industrial and CTS DSM profiles from the - `OpenEnergy DataBase `_. + `OpenEnergy DataBase `_. Profiles comprise minimum and maximum load increase in MW as well as maximum energy pre- and postponing in MWh. diff --git a/edisgo/io/generators_import.py b/edisgo/io/generators_import.py index e9628c6d9..281e78a04 100755 --- a/edisgo/io/generators_import.py +++ b/edisgo/io/generators_import.py @@ -42,9 +42,9 @@ def oedb_legacy(edisgo_object, generator_scenario, **kwargs): The importer uses SQLAlchemy ORM objects. These are defined in `ego.io `_. The data is imported from the tables - `conventional power plants `_ and - `renewable power plants `_. When the generator data is retrieved, the following steps are conducted: diff --git a/edisgo/io/heat_pump_import.py b/edisgo/io/heat_pump_import.py index bb80064b7..69133ca11 100644 --- a/edisgo/io/heat_pump_import.py +++ b/edisgo/io/heat_pump_import.py @@ -583,7 +583,7 @@ def _grid_integration( def efficiency_resistive_heaters_oedb(scenario, engine): """ Get efficiency of resistive heaters from the - `OpenEnergy DataBase `_. + `OpenEnergy DataBase `_. Parameters ---------- diff --git a/edisgo/io/timeseries_import.py b/edisgo/io/timeseries_import.py index 83e4afc65..5d154b965 100644 --- a/edisgo/io/timeseries_import.py +++ b/edisgo/io/timeseries_import.py @@ -74,7 +74,7 @@ def _timeindex_helper_func( def feedin_oedb_legacy(edisgo_object, timeindex=None): """ Import feed-in time series data for wind and solar power plants from the - `OpenEnergy DataBase `_. + `OpenEnergy DataBase `_. Parameters ---------- @@ -158,7 +158,7 @@ def feedin_oedb( ): """ Import feed-in time series data for wind and solar power plants from the - `OpenEnergy DataBase `_. + `OpenEnergy DataBase `_. Parameters ---------- @@ -319,7 +319,7 @@ def load_time_series_demandlib(edisgo_obj, timeindex=None): def cop_oedb(edisgo_object, engine, weather_cell_ids, timeindex=None): """ Get COP (coefficient of performance) time series data from the - `OpenEnergy DataBase `_. + `OpenEnergy DataBase `_. Parameters ---------- @@ -377,7 +377,7 @@ def cop_oedb(edisgo_object, engine, weather_cell_ids, timeindex=None): def heat_demand_oedb(edisgo_obj, scenario, engine, timeindex=None): """ Get heat demand profiles for heat pumps from the - `OpenEnergy DataBase `_. + `OpenEnergy DataBase `_. Heat demand data is returned for all heat pumps in the grid. For more information on how individual heat demand profiles are obtained see @@ -498,7 +498,7 @@ def electricity_demand_oedb( ): """ Get electricity demand profiles for all conventional loads from the - `OpenEnergy DataBase `_. + `OpenEnergy DataBase `_. Conventional loads comprise conventional electricity applications in the residential, CTS and industrial sector. diff --git a/edisgo/network/heat.py b/edisgo/network/heat.py index 22403d0f2..1762f56c7 100644 --- a/edisgo/network/heat.py +++ b/edisgo/network/heat.py @@ -131,7 +131,7 @@ def set_cop(self, edisgo_object, ts_cop, **kwargs): Write COP time series for heat pumps to py:attr:`~cop_df`. COP time series can either be given to this function or be obtained from the - `OpenEnergy DataBase `_. + `OpenEnergy DataBase `_. In case they are obtained from the OpenEnergy DataBase the heat pumps need to already be integrated into the grid, i.e. given in :attr:`~.network.topology.Topology.loads_df`. @@ -150,7 +150,7 @@ def set_cop(self, edisgo_object, ts_cop, **kwargs): * 'oedb' COP / efficiency data are obtained from the `OpenEnergy DataBase - `_. + `_. In case of heat pumps weather cell specific hourly COP time series are obtained (see :func:`edisgo.io.timeseries_import.cop_oedb` for more information). Using information on which weather cell each heat pump @@ -317,7 +317,7 @@ def set_heat_demand(self, edisgo_object, ts_heat_demand, **kwargs): Write heat demand time series of heat pumps to py:attr:`~heat_demand_df`. Heat demand time series can either be given to this function or be obtained from - the `OpenEnergy DataBase `_. + the `OpenEnergy DataBase `_. In case they are obtained from the OpenEnergy DataBase the heat pumps need to already be integrated into the grid, i.e. given in :attr:`~.network.topology.Topology.loads_df`. @@ -336,7 +336,7 @@ def set_heat_demand(self, edisgo_object, ts_heat_demand, **kwargs): * 'oedb' Heat demand time series are obtained from the `OpenEnergy DataBase - `_ (see + `_ (see :func:`edisgo.io.timeseries_import.heat_demand_oedb` for more information). Time series are only obtained for heat pumps that are already integrated diff --git a/edisgo/network/timeseries.py b/edisgo/network/timeseries.py index 8da353ff2..585240e98 100644 --- a/edisgo/network/timeseries.py +++ b/edisgo/network/timeseries.py @@ -1204,7 +1204,7 @@ def predefined_fluctuating_generators_by_technology( Technology and weather cell specific hourly feed-in time series are obtained from the `OpenEnergy DataBase - `_. See + `_. See :func:`edisgo.io.timeseries_import.feedin_oedb` for more information. This option requires that the parameter `engine` is provided in case From 41888aa0bb1e2d705d303b5aefd55c790c833ed9 Mon Sep 17 00:00:00 2001 From: Jonas Danke Date: Mon, 8 Jul 2024 11:43:59 +0200 Subject: [PATCH 2/8] update installation instructions --- doc/dev_notes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/dev_notes.rst b/doc/dev_notes.rst index e012ce874..953ae282b 100644 --- a/doc/dev_notes.rst +++ b/doc/dev_notes.rst @@ -24,7 +24,7 @@ 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 From 64a4f7b7412e4f898e7997a3e8bf36c2a9e646be Mon Sep 17 00:00:00 2001 From: Jonas Danke Date: Mon, 8 Jul 2024 11:54:02 +0200 Subject: [PATCH 3/8] Update PyPSA power flow analysis link in EDisGo class --- edisgo/edisgo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edisgo/edisgo.py b/edisgo/edisgo.py index 52e708b2d..3930a5659 100755 --- a/edisgo/edisgo.py +++ b/edisgo/edisgo.py @@ -1003,7 +1003,7 @@ def analyze( Conducts a static, non-linear power flow analysis. Conducts a static, non-linear power flow analysis using - `PyPSA `_ and writes results (active, reactive and apparent power as well as current on lines and voltages at buses) to :class:`~.network.results.Results` From af1b79d2d7c78216c0f652649dd9fe2ef1d1fe64 Mon Sep 17 00:00:00 2001 From: Jonas Danke Date: Mon, 8 Jul 2024 13:49:24 +0200 Subject: [PATCH 4/8] Update installation instructions for edisgoOPF package --- doc/quickstart.rst | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/doc/quickstart.rst b/doc/quickstart.rst index a4af052f7..f0dad32d6 100644 --- a/doc/quickstart.rst +++ b/doc/quickstart.rst @@ -44,41 +44,41 @@ 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 ----------------------------------- +edisgoOPF Package +----------------- -.. warning:: The non-linear optimal power flow is currently not maintained and might not work out of the box! +Introduction +^^^^^^^^^^^^^ +edisgoOPF is a Python package designed for optimal power flow (OPF) calculations in electrical distribution systems. This package leverages the power of Julia, a high-performance programming language for technical computing, to perform efficient OPF calculations. -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 `_ and -add it to your path (see -`platform specific instructions `_ -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 +To use edisgoOPF effectively, you'll need to set up a specific environment that includes: - ] +1. **Julia**: Version 1.6.7 is required. +2. **Gurobi Optimizer**: A powerful optimization solver. -Then activate the package: +Installation Steps +^^^^^^^^^^^^^^^^^^^ + +1. Install Julia 1.6.7 -.. code-block:: bash - (v1.0) pkg> activate . +Download Julia 1.6.7 from the `Julia LTS releases page `_. -And finally instantiate it: +For Linux users, you can use the following commands: .. code-block:: bash - (SomeProject) pkg> instantiate + wget https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.7-linux-x86_64.tar.gz + tar zxvf julia-1.6.7-linux-x86_64.tar.gz + export PATH="$PATH:/julia-1.6.7/bin" + +2. Install Gurobi + + +Follow the `Gurobi installation guide `_ to install Gurobi and add it to your system path. -.. _prerequisites: Additional linear solver ^^^^^^^^^^^^^^^^^^^^^^^^^ From 579eb5647c796c3e06e4db3311a871c781d820b2 Mon Sep 17 00:00:00 2001 From: joda9 Date: Mon, 8 Jul 2024 17:13:59 +0200 Subject: [PATCH 5/8] add linkcheck_ignore gurobi --- doc/conf.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index ad1be2546..134f16573 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -138,9 +138,14 @@ def setup(sphinx): ), } # 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/hc/en-us/articles\ + /14799677517585-Getting-Started-with-Gurobi-Optimizer", +] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] From a090f0d8c0a6a29d7b966e23a2095f80f0aceeb6 Mon Sep 17 00:00:00 2001 From: joda9 <66819219+joda9@users.noreply.github.com> Date: Mon, 8 Jul 2024 17:19:09 +0200 Subject: [PATCH 6/8] Update conf.py --- doc/conf.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 134f16573..2b2867de2 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -143,8 +143,7 @@ def setup(sphinx): # in the github action, even though the link is correct linkcheck_ignore = [ r"https://stackoverflow.com*", - r"https://support.gurobi.com/hc/en-us/articles\ - /14799677517585-Getting-Started-with-Gurobi-Optimizer", + r"https://support.gurobi.com/*", ] # Add any paths that contain templates here, relative to this directory. From 04878dd2854342e68c6e587adec95c99e429593c Mon Sep 17 00:00:00 2001 From: birgits Date: Wed, 10 Jul 2024 16:08:58 +0200 Subject: [PATCH 7/8] Adapt installation documentation --- doc/quickstart.rst | 95 +++------------------------------------------- 1 file changed, 5 insertions(+), 90 deletions(-) diff --git a/doc/quickstart.rst b/doc/quickstart.rst index f0dad32d6..2d64df52f 100644 --- a/doc/quickstart.rst +++ b/doc/quickstart.rst @@ -3,11 +3,11 @@ Getting started ================ +.. warning:: Make sure to use python 3.8 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. @@ -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 `_ @@ -44,16 +42,10 @@ 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! -edisgoOPF Package ------------------ +Additional requirements for Optimal Power Flow +--------------------------------------------------- -Introduction -^^^^^^^^^^^^^ -edisgoOPF is a Python package designed for optimal power flow (OPF) calculations in electrical distribution systems. This package leverages the power of Julia, a high-performance programming language for technical computing, to perform efficient OPF calculations. - - - -To use edisgoOPF effectively, you'll need to set up a specific environment that includes: +In order to use the optimal power flow, you additionally need: 1. **Julia**: Version 1.6.7 is required. 2. **Gurobi Optimizer**: A powerful optimization solver. @@ -79,83 +71,6 @@ For Linux users, you can use the following commands: Follow the `Gurobi installation guide `_ to install Gurobi and add it to your system path. - -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 `_. -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: - -.. 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 - -You can then configure and install your HSL Solvers: - -.. 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: - -.. code-block:: bash - - Libraries have been installed in: - /usr/local/lib - - -Add this path to the variable `LD_LIBRARY_PATH`: - -.. 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 - - cd /usr/local/lib - ln -s libcoinhsl.so libhsl.so - -MA97 should now work and can be called from Julia with: - -.. code-block:: julia - - JuMP.setsolver(pm.model,IpoptSolver(linear_solver="ma97")) - Prerequisites ------------- From 2f06b51bd3b0b4b614223f6d905eac50eccd22c2 Mon Sep 17 00:00:00 2001 From: joda9 Date: Wed, 10 Jul 2024 17:17:57 +0200 Subject: [PATCH 8/8] Update installation instructions for Julia --- doc/quickstart.rst | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/doc/quickstart.rst b/doc/quickstart.rst index 2d64df52f..04f12fbaf 100644 --- a/doc/quickstart.rst +++ b/doc/quickstart.rst @@ -58,13 +58,8 @@ Installation Steps Download Julia 1.6.7 from the `Julia LTS releases page `_. -For Linux users, you can use the following commands: +Install Julia by following the instructions in the `Julia installation guide `_. Make sure to add Julia to your system path. -.. code-block:: bash - - wget https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.7-linux-x86_64.tar.gz - tar zxvf julia-1.6.7-linux-x86_64.tar.gz - export PATH="$PATH:/julia-1.6.7/bin" 2. Install Gurobi