[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-11-11 23:16:02 +00:00
parent 6cd46bf261
commit ff209bbd76
2 changed files with 9 additions and 12 deletions

View File

@ -710,7 +710,7 @@ rule build_egs_potentials:
input:
egs_cost="data/egs_costs.json",
regions=RESOURCES + "regions_onshore_elec_s{simpl}_{clusters}.geojson",
air_temperature=RESOURCES + "temp_air_total_elec_s{simpl}_{clusters}.nc"
air_temperature=RESOURCES + "temp_air_total_elec_s{simpl}_{clusters}.nc"
if config["sector"]["enhanced_geothermal_var_cf"]
else [],
output:

View File

@ -22,10 +22,10 @@ logger = logging.getLogger(__name__)
import json
import geopandas as gpd
import numpy as np
import pandas as pd
import xarray as xr
import geopandas as gpd
from shapely.geometry import Polygon
@ -86,14 +86,12 @@ def prepare_egs_data(egs_file):
return egs_data
def get_capacity_factors(
network_regions_file,
air_temperatures_file
):
def get_capacity_factors(network_regions_file, air_temperatures_file):
"""
Performance of EGS is higher for lower temperatures, due to more efficient
air cooling Data from Ricks et al.: The Role of Flexible Geothermal Power
in Decarbonized Elec Systems.
"""
Performance of EGS is higher for lower temperatures, due to more efficient air cooling
Data from Ricks et al.: The Role of Flexible Geothermal Power in Decarbonized Elec Systems
"""
delta_T = [-15, -10, -5, 0, 5, 10, 15, 20]
cf = [1.17, 1.13, 1.07, 1, 0.925, 0.84, 0.75, 0.65]
@ -123,9 +121,8 @@ def get_capacity_factors(
for bus in index:
temp = air_temp.sel(name=bus).to_dataframe()["temperature"]
capacity_factors[bus] = np.interp((temp - temp.mean()).values, x, y)
return capacity_factors
return capacity_factors
if __name__ == "__main__":
@ -191,4 +188,4 @@ if __name__ == "__main__":
snakemake.input["air_temperature"],
)
capacity_factors.to_csv(snakemake.output["egs_capacity_factors"])
capacity_factors.to_csv(snakemake.output["egs_capacity_factors"])