diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7e2f1149..4279b96a 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -39,7 +39,7 @@ repos:
# Make docstrings PEP 257 compliant
- repo: https://github.com/PyCQA/docformatter
- rev: v1.6.0
+ rev: v1.6.1-rc1
hooks:
- id: docformatter
args: ["--in-place", "--make-summary-multi-line", "--pre-summary-newline"]
diff --git a/scripts/add_brownfield.py b/scripts/add_brownfield.py
index dc782838..e08b86d7 100644
--- a/scripts/add_brownfield.py
+++ b/scripts/add_brownfield.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Prepares brownfield data from previous planning horizon.
"""
diff --git a/scripts/add_existing_baseyear.py b/scripts/add_existing_baseyear.py
index 992f3f98..5bc0960d 100644
--- a/scripts/add_existing_baseyear.py
+++ b/scripts/add_existing_baseyear.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Adds existing power and heat generation capacities for initial planning
horizon.
diff --git a/scripts/build_biomass_transport_costs.py b/scripts/build_biomass_transport_costs.py
index 8b6b6927..9271b600 100644
--- a/scripts/build_biomass_transport_costs.py
+++ b/scripts/build_biomass_transport_costs.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Reads biomass transport costs for different countries of the JRC report.
diff --git a/scripts/build_bus_regions.py b/scripts/build_bus_regions.py
index f1a0558a..cfbf90f7 100644
--- a/scripts/build_bus_regions.py
+++ b/scripts/build_bus_regions.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Creates Voronoi shapes for each bus representing both onshore and offshore
regions.
diff --git a/scripts/build_clustered_population_layouts.py b/scripts/build_clustered_population_layouts.py
index bc81c29a..083f3de4 100644
--- a/scripts/build_clustered_population_layouts.py
+++ b/scripts/build_clustered_population_layouts.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build population layouts for all clustered model regions as total as well as
split by urban and rural population.
diff --git a/scripts/build_cop_profiles.py b/scripts/build_cop_profiles.py
index 91d03469..342bd7e0 100644
--- a/scripts/build_cop_profiles.py
+++ b/scripts/build_cop_profiles.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build coefficient of performance (COP) time series for air- or ground-sourced
heat pumps.
diff --git a/scripts/build_cutout.py b/scripts/build_cutout.py
index fd148cac..eefa881b 100644
--- a/scripts/build_cutout.py
+++ b/scripts/build_cutout.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Create cutouts with `atlite `_.
diff --git a/scripts/build_electricity_demand.py b/scripts/build_electricity_demand.py
index 4bf0306b..30f24f5c 100755
--- a/scripts/build_electricity_demand.py
+++ b/scripts/build_electricity_demand.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020 @JanFrederickUnnewehr, The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
This rule downloads the load data from `Open Power System Data Time series.
diff --git a/scripts/build_energy_totals.py b/scripts/build_energy_totals.py
index f11c134f..45fc960f 100644
--- a/scripts/build_energy_totals.py
+++ b/scripts/build_energy_totals.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build total energy demands per country using JRC IDEES, eurostat, and EEA data.
"""
diff --git a/scripts/build_gas_input_locations.py b/scripts/build_gas_input_locations.py
index 314cb767..a3b945ab 100644
--- a/scripts/build_gas_input_locations.py
+++ b/scripts/build_gas_input_locations.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2021-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build import locations for fossil gas from entry-points, LNG terminals and
production sites with data from SciGRID_gas and Global Energy Monitor.
diff --git a/scripts/build_gas_network.py b/scripts/build_gas_network.py
index a9f28e0d..f3021022 100644
--- a/scripts/build_gas_network.py
+++ b/scripts/build_gas_network.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Preprocess gas network based on data from bthe SciGRID_gas project
(https://www.gas.scigrid.de/).
diff --git a/scripts/build_heat_demand.py b/scripts/build_heat_demand.py
index 6164d25d..56ceb4b7 100644
--- a/scripts/build_heat_demand.py
+++ b/scripts/build_heat_demand.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build heat demand time series using heating degree day (HDD) approximation.
"""
diff --git a/scripts/build_hydro_profile.py b/scripts/build_hydro_profile.py
index 279bd7a1..9adf7112 100644
--- a/scripts/build_hydro_profile.py
+++ b/scripts/build_hydro_profile.py
@@ -4,7 +4,6 @@
# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build hydroelectric inflow time-series for each country.
diff --git a/scripts/build_industrial_distribution_key.py b/scripts/build_industrial_distribution_key.py
index d4518d1c..69daf64d 100644
--- a/scripts/build_industrial_distribution_key.py
+++ b/scripts/build_industrial_distribution_key.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build spatial distribution of industries from Hotmaps database.
"""
diff --git a/scripts/build_industrial_energy_demand_per_country_today.py b/scripts/build_industrial_energy_demand_per_country_today.py
index 3fa9ef56..703997b1 100644
--- a/scripts/build_industrial_energy_demand_per_country_today.py
+++ b/scripts/build_industrial_energy_demand_per_country_today.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build industrial energy demand per country.
"""
diff --git a/scripts/build_industrial_energy_demand_per_node.py b/scripts/build_industrial_energy_demand_per_node.py
index b75b2058..55c10c5d 100644
--- a/scripts/build_industrial_energy_demand_per_node.py
+++ b/scripts/build_industrial_energy_demand_per_node.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build industrial energy demand per model region.
"""
diff --git a/scripts/build_industrial_energy_demand_per_node_today.py b/scripts/build_industrial_energy_demand_per_node_today.py
index da1ec2d7..d845e704 100644
--- a/scripts/build_industrial_energy_demand_per_node_today.py
+++ b/scripts/build_industrial_energy_demand_per_node_today.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build industrial energy demand per model region.
"""
diff --git a/scripts/build_industrial_production_per_country.py b/scripts/build_industrial_production_per_country.py
index 1c2e4557..437806b3 100644
--- a/scripts/build_industrial_production_per_country.py
+++ b/scripts/build_industrial_production_per_country.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build industrial production per country.
"""
diff --git a/scripts/build_industrial_production_per_country_tomorrow.py b/scripts/build_industrial_production_per_country_tomorrow.py
index e554e159..6c445608 100644
--- a/scripts/build_industrial_production_per_country_tomorrow.py
+++ b/scripts/build_industrial_production_per_country_tomorrow.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build future industrial production per country.
"""
diff --git a/scripts/build_industrial_production_per_node.py b/scripts/build_industrial_production_per_node.py
index 7b40cb7c..7b69948a 100644
--- a/scripts/build_industrial_production_per_node.py
+++ b/scripts/build_industrial_production_per_node.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build industrial production per model region.
"""
diff --git a/scripts/build_industry_sector_ratios.py b/scripts/build_industry_sector_ratios.py
index 5f5f7b90..54f2cfdc 100644
--- a/scripts/build_industry_sector_ratios.py
+++ b/scripts/build_industry_sector_ratios.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build specific energy consumption by carrier and industries.
"""
diff --git a/scripts/build_natura_raster.py b/scripts/build_natura_raster.py
index 9246508e..12011cd0 100644
--- a/scripts/build_natura_raster.py
+++ b/scripts/build_natura_raster.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Rasters the vector data of the `Natura 2000.
diff --git a/scripts/build_population_layouts.py b/scripts/build_population_layouts.py
index a9308b7e..e864d925 100644
--- a/scripts/build_population_layouts.py
+++ b/scripts/build_population_layouts.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build mapping between cutout grid cells and population (total, urban, rural).
"""
diff --git a/scripts/build_population_weighted_energy_totals.py b/scripts/build_population_weighted_energy_totals.py
index 85d7a8b3..879e3b9b 100644
--- a/scripts/build_population_weighted_energy_totals.py
+++ b/scripts/build_population_weighted_energy_totals.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Distribute country-level energy demands by population.
"""
diff --git a/scripts/build_renewable_profiles.py b/scripts/build_renewable_profiles.py
index ea4dfa9a..6f03d746 100644
--- a/scripts/build_renewable_profiles.py
+++ b/scripts/build_renewable_profiles.py
@@ -4,7 +4,6 @@
# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Calculates for each network node the (i) installable capacity (based on land-
use), (ii) the available generation time series (based on weather data), and
diff --git a/scripts/build_retro_cost.py b/scripts/build_retro_cost.py
index 72792c92..cd1dae8d 100644
--- a/scripts/build_retro_cost.py
+++ b/scripts/build_retro_cost.py
@@ -3,7 +3,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
This script calculates the space heating savings through better insulation of
the thermal envelope of a building and corresponding costs for different
diff --git a/scripts/build_salt_cavern_potentials.py b/scripts/build_salt_cavern_potentials.py
index 3fed7f91..956ed431 100644
--- a/scripts/build_salt_cavern_potentials.py
+++ b/scripts/build_salt_cavern_potentials.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build salt cavern potentials for hydrogen storage.
diff --git a/scripts/build_sequestration_potentials.py b/scripts/build_sequestration_potentials.py
index e17d4f0e..012effe8 100644
--- a/scripts/build_sequestration_potentials.py
+++ b/scripts/build_sequestration_potentials.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build regionalised geological sequestration potential for carbon dioxide using
data from `CO2Stop
diff --git a/scripts/build_ship_raster.py b/scripts/build_ship_raster.py
index 9d9dda0b..abfcdfa1 100644
--- a/scripts/build_ship_raster.py
+++ b/scripts/build_ship_raster.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2022 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Transforms the global ship density data from the `World Bank Data Catalogue.
diff --git a/scripts/build_solar_thermal_profiles.py b/scripts/build_solar_thermal_profiles.py
index 1cec57f1..f4eb1557 100644
--- a/scripts/build_solar_thermal_profiles.py
+++ b/scripts/build_solar_thermal_profiles.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build solar thermal collector time series.
"""
diff --git a/scripts/build_temperature_profiles.py b/scripts/build_temperature_profiles.py
index b1973fd8..8f6d6c6c 100644
--- a/scripts/build_temperature_profiles.py
+++ b/scripts/build_temperature_profiles.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build time series for air and soil temperatures per clustered model region.
"""
diff --git a/scripts/build_transport_demand.py b/scripts/build_transport_demand.py
index 29973da3..6b8bd04f 100644
--- a/scripts/build_transport_demand.py
+++ b/scripts/build_transport_demand.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Build land transport demand per clustered model region including efficiency
improvements due to drivetrain changes, time series for electric vehicle
diff --git a/scripts/cluster_gas_network.py b/scripts/cluster_gas_network.py
index 44188638..e7554dff 100755
--- a/scripts/cluster_gas_network.py
+++ b/scripts/cluster_gas_network.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Cluster gas transmission network to clustered model regions.
"""
diff --git a/scripts/copy_config.py b/scripts/copy_config.py
index c79e578c..d2108f4d 100644
--- a/scripts/copy_config.py
+++ b/scripts/copy_config.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Copy used configuration files and important scripts for archiving.
"""
diff --git a/scripts/make_summary.py b/scripts/make_summary.py
index 7b33aed8..3d743942 100644
--- a/scripts/make_summary.py
+++ b/scripts/make_summary.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Create summary CSV files for all scenario runs including costs, capacities,
capacity factors, curtailment, energy balances, prices and other metrics.
diff --git a/scripts/plot_network.py b/scripts/plot_network.py
index 7c194b0c..0a22b2e5 100644
--- a/scripts/plot_network.py
+++ b/scripts/plot_network.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Creates plots for optimised network topologies, including electricity, gas and
hydrogen networks, and regional generation, storage and conversion capacities
diff --git a/scripts/plot_summary.py b/scripts/plot_summary.py
index 339a8457..cfa8e361 100644
--- a/scripts/plot_summary.py
+++ b/scripts/plot_summary.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Creates plots from summary CSV files.
"""
diff --git a/scripts/prepare_links_p_nom.py b/scripts/prepare_links_p_nom.py
index 7c63f3a4..7941b69a 100644
--- a/scripts/prepare_links_p_nom.py
+++ b/scripts/prepare_links_p_nom.py
@@ -4,7 +4,6 @@
# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Extracts capacities of HVDC links from `Wikipedia.
diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py
index 5937eb96..6129d3b5 100644
--- a/scripts/prepare_sector_network.py
+++ b/scripts/prepare_sector_network.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2020-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Adds all sector-coupling components to the network, including demand and supply
technologies for the buildings, transport and industry sectors.
diff --git a/scripts/retrieve_databundle.py b/scripts/retrieve_databundle.py
index b3a6cb4e..52884328 100644
--- a/scripts/retrieve_databundle.py
+++ b/scripts/retrieve_databundle.py
@@ -3,7 +3,6 @@
# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3517935.svg
:target: https://doi.org/10.5281/zenodo.3517935
diff --git a/scripts/solve_network.py b/scripts/solve_network.py
index 5b580bac..2b8cbb13 100644
--- a/scripts/solve_network.py
+++ b/scripts/solve_network.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Solves optimal operation and capacity for a network with the option to
iteratively optimize while updating line reactances.
@@ -444,7 +443,7 @@ def add_operational_reserve_margin(n, sns, config):
n.model.add_constraints(lhs >= rhs, name="reserve_margin")
- # additional contraint that capacity is not exceeded
+ # additional constraint that capacity is not exceeded
gen_i = n.generators.index
ext_i = n.generators.query("p_nom_extendable").index
fix_i = n.generators.query("not p_nom_extendable").index
diff --git a/scripts/solve_operations_network.py b/scripts/solve_operations_network.py
index d16b60aa..25fe0753 100644
--- a/scripts/solve_operations_network.py
+++ b/scripts/solve_operations_network.py
@@ -2,7 +2,6 @@
# SPDX-FileCopyrightText: : 2017-2023 The PyPSA-Eur Authors
#
# SPDX-License-Identifier: MIT
-
"""
Solves linear optimal dispatch in hourly resolution using the capacities of
previous capacity expansion in rule :mod:`solve_network`.