[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
4f9a5d6946
commit
985aecb0c4
@ -396,7 +396,7 @@ rule add_electricity:
|
|||||||
else resources("networks/base.nc")
|
else resources("networks/base.nc")
|
||||||
),
|
),
|
||||||
tech_costs=lambda w: resources(
|
tech_costs=lambda w: resources(
|
||||||
f"costs_{config_provider('costs', 'year') (w)}.csv"
|
f"costs_{config_provider('costs', 'year')(w)}.csv"
|
||||||
),
|
),
|
||||||
regions=resources("regions_onshore.geojson"),
|
regions=resources("regions_onshore.geojson"),
|
||||||
powerplants=resources("powerplants.csv"),
|
powerplants=resources("powerplants.csv"),
|
||||||
@ -441,7 +441,7 @@ rule simplify_network:
|
|||||||
input:
|
input:
|
||||||
network=resources("networks/elec.nc"),
|
network=resources("networks/elec.nc"),
|
||||||
tech_costs=lambda w: resources(
|
tech_costs=lambda w: resources(
|
||||||
f"costs_{config_provider('costs', 'year') (w)}.csv"
|
f"costs_{config_provider('costs', 'year')(w)}.csv"
|
||||||
),
|
),
|
||||||
regions_onshore=resources("regions_onshore.geojson"),
|
regions_onshore=resources("regions_onshore.geojson"),
|
||||||
regions_offshore=resources("regions_offshore.geojson"),
|
regions_offshore=resources("regions_offshore.geojson"),
|
||||||
@ -489,7 +489,7 @@ rule cluster_network:
|
|||||||
else []
|
else []
|
||||||
),
|
),
|
||||||
tech_costs=lambda w: resources(
|
tech_costs=lambda w: resources(
|
||||||
f"costs_{config_provider('costs', 'year') (w)}.csv"
|
f"costs_{config_provider('costs', 'year')(w)}.csv"
|
||||||
),
|
),
|
||||||
output:
|
output:
|
||||||
network=resources("networks/elec_s{simpl}_{clusters}.nc"),
|
network=resources("networks/elec_s{simpl}_{clusters}.nc"),
|
||||||
@ -518,7 +518,7 @@ rule add_extra_components:
|
|||||||
input:
|
input:
|
||||||
network=resources("networks/elec_s{simpl}_{clusters}.nc"),
|
network=resources("networks/elec_s{simpl}_{clusters}.nc"),
|
||||||
tech_costs=lambda w: resources(
|
tech_costs=lambda w: resources(
|
||||||
f"costs_{config_provider('costs', 'year') (w)}.csv"
|
f"costs_{config_provider('costs', 'year')(w)}.csv"
|
||||||
),
|
),
|
||||||
output:
|
output:
|
||||||
resources("networks/elec_s{simpl}_{clusters}_ec.nc"),
|
resources("networks/elec_s{simpl}_{clusters}_ec.nc"),
|
||||||
@ -553,7 +553,7 @@ rule prepare_network:
|
|||||||
input:
|
input:
|
||||||
resources("networks/elec_s{simpl}_{clusters}_ec.nc"),
|
resources("networks/elec_s{simpl}_{clusters}_ec.nc"),
|
||||||
tech_costs=lambda w: resources(
|
tech_costs=lambda w: resources(
|
||||||
f"costs_{config_provider('costs', 'year') (w)}.csv"
|
f"costs_{config_provider('costs', 'year')(w)}.csv"
|
||||||
),
|
),
|
||||||
co2_price=lambda w: resources("co2_price.csv") if "Ept" in w.opts else [],
|
co2_price=lambda w: resources("co2_price.csv") if "Ept" in w.opts else [],
|
||||||
output:
|
output:
|
||||||
|
@ -249,7 +249,7 @@ if config["enable"]["retrieve"]:
|
|||||||
layer_path = (
|
layer_path = (
|
||||||
f"/vsizip/{params.folder}/WDPA_{bYYYY}_Public_shp_{i}.zip"
|
f"/vsizip/{params.folder}/WDPA_{bYYYY}_Public_shp_{i}.zip"
|
||||||
)
|
)
|
||||||
print(f"Adding layer {i + 1} of 3 to combined output file.")
|
print(f"Adding layer {i+1} of 3 to combined output file.")
|
||||||
shell("ogr2ogr -f gpkg -update -append {output.gpkg} {layer_path}")
|
shell("ogr2ogr -f gpkg -update -append {output.gpkg} {layer_path}")
|
||||||
|
|
||||||
rule download_wdpa_marine:
|
rule download_wdpa_marine:
|
||||||
@ -272,7 +272,7 @@ if config["enable"]["retrieve"]:
|
|||||||
for i in range(3):
|
for i in range(3):
|
||||||
# vsizip is special driver for directly working with zipped shapefiles in ogr2ogr
|
# vsizip is special driver for directly working with zipped shapefiles in ogr2ogr
|
||||||
layer_path = f"/vsizip/{params.folder}/WDPA_WDOECM_{bYYYY}_Public_marine_shp_{i}.zip"
|
layer_path = f"/vsizip/{params.folder}/WDPA_WDOECM_{bYYYY}_Public_marine_shp_{i}.zip"
|
||||||
print(f"Adding layer {i + 1} of 3 to combined output file.")
|
print(f"Adding layer {i+1} of 3 to combined output file.")
|
||||||
shell("ogr2ogr -f gpkg -update -append {output.gpkg} {layer_path}")
|
shell("ogr2ogr -f gpkg -update -append {output.gpkg} {layer_path}")
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,16 +111,12 @@ def add_brownfield(n, n_p, year):
|
|||||||
.groupby(level=0)
|
.groupby(level=0)
|
||||||
.sum()
|
.sum()
|
||||||
)
|
)
|
||||||
remaining_capacity = (
|
remaining_capacity = pipe_capacity - CH4_per_H2 * already_retrofitted.reindex(
|
||||||
pipe_capacity
|
index=pipe_capacity.index
|
||||||
- CH4_per_H2
|
).fillna(0)
|
||||||
* already_retrofitted.reindex(index=pipe_capacity.index).fillna(0)
|
|
||||||
)
|
|
||||||
n.links.loc[gas_pipes_i, "p_nom"] = remaining_capacity
|
n.links.loc[gas_pipes_i, "p_nom"] = remaining_capacity
|
||||||
else:
|
else:
|
||||||
new_pipes = n.links.carrier.isin(pipe_carrier) & (
|
new_pipes = n.links.carrier.isin(pipe_carrier) & (n.links.build_year == year)
|
||||||
n.links.build_year == year
|
|
||||||
)
|
|
||||||
n.links.loc[new_pipes, "p_nom"] = 0.0
|
n.links.loc[new_pipes, "p_nom"] = 0.0
|
||||||
n.links.loc[new_pipes, "p_nom_min"] = 0.0
|
n.links.loc[new_pipes, "p_nom_min"] = 0.0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user