[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-01 06:43:45 +00:00
parent 23eb3548c5
commit 7530c42fbe
3 changed files with 27 additions and 20 deletions

View File

@ -205,24 +205,31 @@ rule build_ship_raster:
rule determine_availability_matrix_MD_UA: rule determine_availability_matrix_MD_UA:
input: input:
copernicus=RESOURCES + "Copernicus_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif", copernicus=RESOURCES
gebco=lambda w: ("data/bundle/GEBCO_2014_2D.nc" + "Copernicus_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif",
if "max_depth" in config["renewable"][w.technology].keys() gebco=lambda w: (
else []), "data/bundle/GEBCO_2014_2D.nc"
country_shapes=RESOURCES + 'country_shapes.geojson', if "max_depth" in config["renewable"][w.technology].keys()
offshore_shapes=RESOURCES + 'offshore_shapes.geojson', else []
regions=lambda w: (RESOURCES + "regions_onshore.geojson" ),
if w.technology in ('onwind', 'solar') country_shapes=RESOURCES + "country_shapes.geojson",
else RESOURCES + "regions_offshore.geojson"), offshore_shapes=RESOURCES + "offshore_shapes.geojson",
cutout=lambda w: "cutouts/" + CDIR + config["renewable"][w.technology]['cutout'] + ".nc" regions=lambda w: (
RESOURCES + "regions_onshore.geojson"
if w.technology in ("onwind", "solar")
else RESOURCES + "regions_offshore.geojson"
),
cutout=lambda w: "cutouts/"
+ CDIR
+ config["renewable"][w.technology]["cutout"]
+ ".nc",
output: output:
availability_matrix=RESOURCES + "availability_matrix_MD-UA_{technology}.nc", availability_matrix=RESOURCES + "availability_matrix_MD-UA_{technology}.nc",
log: log:
LOGS + "determine_availability_matrix_MD_UA_{technology}.log", LOGS + "determine_availability_matrix_MD_UA_{technology}.log",
threads: threads: ATLITE_NPROCESSES
ATLITE_NPROCESSES
resources: resources:
mem_mb=ATLITE_NPROCESSES * 5000 mem_mb=ATLITE_NPROCESSES * 5000,
conda: conda:
"../envs/environment.yaml" "../envs/environment.yaml"
script: script:
@ -232,7 +239,8 @@ rule determine_availability_matrix_MD_UA:
# Optional input when having Ukraine (UA) or Moldova (MD) in the countries list # Optional input when having Ukraine (UA) or Moldova (MD) in the countries list
if {"UA", "MD"}.intersection(set(config["countries"])): if {"UA", "MD"}.intersection(set(config["countries"])):
opt = { opt = {
"availability_matrix_MD_UA": RESOURCES + "availability_matrix_MD-UA_{technology}.nc" "availability_matrix_MD_UA": RESOURCES
+ "availability_matrix_MD-UA_{technology}.nc"
} }
else: else:
opt = {} opt = {}
@ -242,6 +250,7 @@ rule build_renewable_profiles:
params: params:
renewable=config["renewable"], renewable=config["renewable"],
input: input:
**opt,
base_network=RESOURCES + "networks/base.nc", base_network=RESOURCES + "networks/base.nc",
corine=ancient("data/bundle/corine/g250_clc06_V18_5.tif"), corine=ancient("data/bundle/corine/g250_clc06_V18_5.tif"),
natura=lambda w: ( natura=lambda w: (
@ -272,7 +281,6 @@ rule build_renewable_profiles:
+ CDIR + CDIR
+ config["renewable"][w.technology]["cutout"] + config["renewable"][w.technology]["cutout"]
+ ".nc", + ".nc",
**opt
output: output:
profile=RESOURCES + "profile_{technology}.nc", profile=RESOURCES + "profile_{technology}.nc",
log: log:
@ -365,7 +373,7 @@ rule add_electricity:
geth_hydro_capacities="data/geth2015_hydro_capacities.csv", geth_hydro_capacities="data/geth2015_hydro_capacities.csv",
load=RESOURCES + "load.csv", load=RESOURCES + "load.csv",
nuts3_shapes=RESOURCES + "nuts3_shapes.geojson", nuts3_shapes=RESOURCES + "nuts3_shapes.geojson",
ua_md_gdp='data/GDP_PPP_30arcsec_v3_mapped_default.csv', ua_md_gdp="data/GDP_PPP_30arcsec_v3_mapped_default.csv",
output: output:
RESOURCES + "networks/elec.nc", RESOURCES + "networks/elec.nc",
log: log:

View File

@ -205,4 +205,3 @@ if config["enable"]["retrieve"]:
output: output:
RESOURCES + "Copernicus_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif", RESOURCES + "Copernicus_LC100_global_v3.0.1_2019-nrt_Discrete-Classification-map_EPSG-4326.tif",
run: move(input[0], output[0]) run: move(input[0], output[0])

View File

@ -3,13 +3,13 @@
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
import geopandas as gpd
import numpy as np
import functools import functools
import atlite
import logging import logging
import time import time
import atlite
import geopandas as gpd
import numpy as np
from _helpers import configure_logging from _helpers import configure_logging
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)