From f8d178c7147a22d8b10ae3e43aefa3d58703998a Mon Sep 17 00:00:00 2001 From: Fabian Date: Fri, 10 Mar 2023 14:26:31 +0100 Subject: [PATCH] prepare_sector: revert taking mean config.overnight: revert hourly resolution --- scripts/prepare_sector_network.py | 6 ++++-- test/config.overnight.yaml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 470867f2..f90f608f 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1409,6 +1409,7 @@ def add_land_transport(n, costs): # TODO options? logger.info("Add land transport") + nsnapshots = n.snapshot_weightings.generators.sum() transport = pd.read_csv( snakemake.input.transport_demand, index_col=0, parse_dates=True @@ -1557,7 +1558,8 @@ def add_land_transport(n, costs): co2 = ( ice_share / ice_efficiency - * transport[nodes].sum(axis=1) + * transport[nodes].sum().sum() + / nsnapshots * costs.at["oil", "CO2 intensity"] ) @@ -3262,7 +3264,7 @@ if __name__ == "__main__": n = pypsa.Network(snakemake.input.network, override_component_attrs=overrides) pop_layout = pd.read_csv(snakemake.input.clustered_pop_layout, index_col=0) - nsnapshots = n.snapshot_weightings.objective.sum() + nsnapshots = n.snapshot_weightings.generators.sum() nyears = nsnapshots / 8760 costs = prepare_costs( diff --git a/test/config.overnight.yaml b/test/config.overnight.yaml index 318dc52a..06cc5fd6 100644 --- a/test/config.overnight.yaml +++ b/test/config.overnight.yaml @@ -16,7 +16,7 @@ scenario: clusters: - 5 sector_opts: - - CO2L0-1H-T-H-B-I-A-solar+p3-dist1 + - CO2L0-24H-T-H-B-I-A-solar+p3-dist1 planning_horizons: - 2030