From ff209bbd76a5b37ad0529ce4e402a9635e26ed23 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:16:02 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- rules/build_sector.smk | 2 +- scripts/build_egs_potentials.py | 19 ++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/rules/build_sector.smk b/rules/build_sector.smk index 94725dca..c412effb 100644 --- a/rules/build_sector.smk +++ b/rules/build_sector.smk @@ -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: diff --git a/scripts/build_egs_potentials.py b/scripts/build_egs_potentials.py index b7de14ff..c86421eb 100644 --- a/scripts/build_egs_potentials.py +++ b/scripts/build_egs_potentials.py @@ -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"]) \ No newline at end of file + capacity_factors.to_csv(snakemake.output["egs_capacity_factors"])