[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2023-08-24 09:12:05 +00:00
parent d0f2d52853
commit b8dee184a9
4 changed files with 20 additions and 8 deletions

View File

@ -350,7 +350,9 @@ rule add_electricity:
hydro_capacities=ancient("data/bundle/hydro_capacities.csv"),
geth_hydro_capacities="data/geth2015_hydro_capacities.csv",
unit_commitment="data/unit_commitment.csv",
fuel_price=RESOURCES + "monthly_fuel_price.csv" if config["conventional"]["dynamic_fuel_price"] else [],
fuel_price=RESOURCES + "monthly_fuel_price.csv"
if config["conventional"]["dynamic_fuel_price"]
else [],
load=RESOURCES + "load.csv",
nuts3_shapes=RESOURCES + "nuts3_shapes.geojson",
output:

View File

@ -117,15 +117,19 @@ if config["enable"]["retrieve"] and config["enable"].get(
]
datafolders = [
protected(directory("data/bundle-sector/eurostat-energy_balances-june_2016_edition")),
protected(directory("data/bundle-sector/eurostat-energy_balances-may_2018_edition")),
protected(
directory("data/bundle-sector/eurostat-energy_balances-june_2016_edition")
),
protected(
directory("data/bundle-sector/eurostat-energy_balances-may_2018_edition")
),
protected(directory("data/bundle-sector/jrc-idees-2015")),
]
rule retrieve_sector_databundle:
output:
protected(expand("data/bundle-sector/{files}", files=datafiles)),
*datafolders
*datafolders,
log:
LOGS + "retrieve_sector_databundle.log",
retries: 2
@ -147,7 +151,9 @@ if config["enable"]["retrieve"] and (
rule retrieve_gas_infrastructure_data:
output:
protected(expand("data/gas_network/scigrid-gas/data/{files}", files=datafiles)),
protected(
expand("data/gas_network/scigrid-gas/data/{files}", files=datafiles)
),
log:
LOGS + "retrieve_gas_infrastructure_data.log",
retries: 2

View File

@ -447,8 +447,11 @@ def add_heating_capacities_installed_before_baseyear(
)
# if rural heating demand for one of the nodes doesn't exist,
# then columns were dropped before and heating demand share should be 0.0
if all(f"{node} {service} rural heat" in p_set_sum.index for service in ["residential", "services"])
else 0.
if all(
f"{node} {service} rural heat" in p_set_sum.index
for service in ["residential", "services"]
)
else 0.0
for node in nodal_df.index
],
index=nodal_df.index,

View File

@ -13,13 +13,14 @@ logger = logging.getLogger(__name__)
import uuid
from itertools import product
import country_converter as coco
import geopandas as gpd
import pandas as pd
from packaging.version import Version, parse
import country_converter as coco
cc = coco.CountryConverter()
def locate_missing_industrial_sites(df):
"""
Locate industrial sites without valid locations based on city and