From c505ea174e7b2272db98fdeefae2540062ea7ad5 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Wed, 24 Apr 2024 16:23:43 +0200 Subject: [PATCH 1/3] doc: update solver requirements [skip ci] --- config/config.default.yaml | 2 +- doc/configtables/solving.csv | 2 +- doc/installation.rst | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/config.default.yaml b/config/config.default.yaml index 42132f22..0db6dc03 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -770,7 +770,7 @@ solving: solver_options: highs-default: - # refer to https://ergo-code.github.io/HiGHS/options/definitions.html#solver + # refer to https://ergo-code.github.io/HiGHS/dev/options/definitions/ threads: 4 solver: "ipm" run_crossover: "off" diff --git a/doc/configtables/solving.csv b/doc/configtables/solving.csv index 7189399b..4d245195 100644 --- a/doc/configtables/solving.csv +++ b/doc/configtables/solving.csv @@ -20,7 +20,7 @@ constraints ,,, -- BAU,bool,"{'true','false'}",Add a per-``carrier`` minimal overall capacity; i.e. at least ``40GW`` of ``OCGT`` in Europe; configured in ``electricity: BAU_mincapacities`` -- SAFE,bool,"{'true','false'}",Add a capacity reserve margin of a certain fraction above the peak demand to which renewable generators and storage do *not* contribute. Ignores network. solver,,, --- name,--,"One of {'gurobi', 'cplex', 'cbc', 'glpk', 'ipopt'}; potentially more possible",Solver to use for optimisation problems in the workflow; e.g. clustering and linear optimal power flow. +-- name,--,"One of {'gurobi', 'cplex', 'highs', 'cbc', 'glpk'}; potentially more possible",Solver to use for optimisation problems in the workflow; e.g. clustering and linear optimal power flow. -- options,--,Key listed under ``solver_options``.,Link to specific parameter settings. solver_options,,dict,Dictionaries with solver-specific parameter settings. mem,MB,int,Estimated maximum memory requirement for solving networks. diff --git a/doc/installation.rst b/doc/installation.rst index dd5c912e..45404e1f 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -62,7 +62,7 @@ PyPSA is known to work with the free software - `HiGHS `__ - `Cbc `__ - `GLPK `__ (`WinGLKP `__) -- `Ipopt `__ +- `SCIP `__ and the non-free, commercial software (for some of which free academic licenses are available) @@ -80,7 +80,7 @@ Nevertheless, you can still use open-source solvers for smaller problems. .. note:: The rules :mod:`cluster_network` and :mod:`simplify_network` solve a mixed-integer quadratic optimisation problem for clustering. - The open-source solvers HiGHS, Cbc and GlPK cannot handle this. A fallback to SCIP is implemented in this case. + The open-source solvers HiGHS, Cbc and GlPK cannot handle this. A fallback to SCIP is implemented in this case, which is included in the standard environment specifications. For an open-source solver setup install in your ``conda`` environment on OSX/Linux. To install the default solver Gurobi, run .. code:: bash From a4a2af5404abf0a5452d68a22986b7cb7d0943ee Mon Sep 17 00:00:00 2001 From: Koen van Greevenbroek Date: Thu, 25 Apr 2024 18:05:41 +0200 Subject: [PATCH 2/3] Fix double space in existing capacities The `name_suffix` variable already includes a space after the bus name. --- scripts/add_existing_baseyear.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/add_existing_baseyear.py b/scripts/add_existing_baseyear.py index e75fe5a2..0ae23125 100644 --- a/scripts/add_existing_baseyear.py +++ b/scripts/add_existing_baseyear.py @@ -310,7 +310,7 @@ def add_power_capacities_installed_before_baseyear(n, grouping_years, costs, bas n.madd( "Generator", new_capacity.index, - suffix=" " + name_suffix, + suffix=name_suffix, bus=new_capacity.index, carrier=generator, p_nom=new_capacity, From 105cadaf7b83a1a549482c3f39f33e2285a0894c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 16:08:45 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- rules/build_electricity.smk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rules/build_electricity.smk b/rules/build_electricity.smk index ed341d2f..c074bdbd 100644 --- a/rules/build_electricity.smk +++ b/rules/build_electricity.smk @@ -433,7 +433,7 @@ rule add_electricity: else resources("networks/base.nc") ), 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"), powerplants=resources("powerplants.csv"), @@ -478,7 +478,7 @@ rule simplify_network: input: network=resources("networks/elec.nc"), 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_offshore=resources("regions_offshore.geojson"), @@ -526,7 +526,7 @@ rule cluster_network: else [] ), tech_costs=lambda w: resources( - f"costs_{config_provider('costs', 'year')(w)}.csv" + f"costs_{config_provider('costs', 'year') (w)}.csv" ), output: network=resources("networks/elec_s{simpl}_{clusters}.nc"), @@ -555,7 +555,7 @@ rule add_extra_components: input: network=resources("networks/elec_s{simpl}_{clusters}.nc"), tech_costs=lambda w: resources( - f"costs_{config_provider('costs', 'year')(w)}.csv" + f"costs_{config_provider('costs', 'year') (w)}.csv" ), output: resources("networks/elec_s{simpl}_{clusters}_ec.nc"), @@ -590,7 +590,7 @@ rule prepare_network: input: resources("networks/elec_s{simpl}_{clusters}_ec.nc"), 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 [], output: