From c7d8af998cff59ce265dd285080e5e7330cf097c Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Mon, 20 May 2024 17:00:56 +0200 Subject: [PATCH] only apply rolling horizon setting in (closes #864) --- doc/configtables/solving.csv | 2 +- doc/release_notes.rst | 2 ++ scripts/solve_network.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/configtables/solving.csv b/doc/configtables/solving.csv index e4e15f1d..4cfb9065 100644 --- a/doc/configtables/solving.csv +++ b/doc/configtables/solving.csv @@ -4,7 +4,7 @@ options,,, -- load_shedding,bool/float,"{'true','false', float}","Add generators with very high marginal cost to simulate load shedding and avoid problem infeasibilities. If load shedding is a float, it denotes the marginal cost in EUR/kWh." -- noisy_costs,bool,"{'true','false'}","Add random noise to marginal cost of generators by :math:`\mathcal{U}(0.009,0,011)` and capital cost of lines and links by :math:`\mathcal{U}(0.09,0,11)`." -- skip_iterations,bool,"{'true','false'}","Skip iterating, do not update impedances of branches. Defaults to true." --- rolling_horizon,bool,"{'true','false'}","Whether to optimize the network in a rolling horizon manner, where the snapshot range is split into slices of size `horizon` which are solved consecutively." +-- rolling_horizon,bool,"{'true','false'}","Switch for rule :mod:`solve_operations_network` whether to optimize the network in a rolling horizon manner, where the snapshot range is split into slices of size `horizon` which are solved consecutively. This setting has currently no effect on sector-coupled networks." -- seed,--,int,Random seed for increased deterministic behaviour. -- custom_extra_functionality,--,str,Path to a Python file with custom extra functionality code to be injected into the solving rules of the workflow relative to ``rules`` directory. -- io_api,string,"{'lp','mps','direct'}",Passed to linopy and determines the API used to communicate with the solver. With the ``'lp'`` and ``'mps'`` options linopy passes a file to the solver; with the ``'direct'`` option (only supported for HIGHS and Gurobi) linopy uses an in-memory python API resulting in better performance. diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 256694ec..9a882629 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -303,6 +303,8 @@ Upcoming Release * Time aggregation for sector-coupled networks have been split into its own rule. When using time step segmentation, time aggregation is constant over planning horizons of the same network. +* Clarify that the rolling-horizon setting ``solving: rolling_horizon:`` only works for the rule :mod:`solve_operations_network` and not for networks with sector-coupling or investment variables. + PyPSA-Eur 0.10.0 (19th February 2024) ===================================== diff --git a/scripts/solve_network.py b/scripts/solve_network.py index a0b28b90..6aedf54b 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -1050,7 +1050,7 @@ def solve_network(n, config, solving, **kwargs): # add to network for extra_functionality n.config = config - if rolling_horizon: + if rolling_horizon and snakemake.rule == 'solve_operations_network': kwargs["horizon"] = cf_solving.get("horizon", 365) kwargs["overlap"] = cf_solving.get("overlap", 0) n.optimize.optimize_with_rolling_horizon(**kwargs)