From fae622155baf2f86c34e37dea7dbe09f9dbace9b Mon Sep 17 00:00:00 2001 From: Bryn Pickering <17178478+brynpickering@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:11:15 +0100 Subject: [PATCH] Remove rogue references to `equals` --- doc/user/advanced_constraints.rst | 43 +--------------------------- src/calliope/config/math_schema.yaml | 6 ---- src/calliope/preprocess/checks.py | 4 +-- 3 files changed, 3 insertions(+), 50 deletions(-) diff --git a/doc/user/advanced_constraints.rst b/doc/user/advanced_constraints.rst index 52e1609b3..4256a0f7e 100644 --- a/doc/user/advanced_constraints.rst +++ b/doc/user/advanced_constraints.rst @@ -274,47 +274,6 @@ Export is an extension of this, allowing a carrier to be removed from the system .. note:: Negative costs can be applied to capacity costs, but the user must an ensure a capacity limit has been set. Otherwise, optimisation will be unbounded. -.. _group_share: - -------------------------------------------- -The ``group_share`` constraint (deprecated) -------------------------------------------- - -.. Warning:: ``group_share`` is deprecated as of v0.6.4 and will be removed in v0.7.0. - -The ``group_share`` constraint can be used to force groups of technologies to fulfill certain shares of supply or capacity. - -For example, assuming a model containing a ``csp`` and a ``cold_fusion`` power generation technology, we could force at least 85% of power generation in the model to come from these two technologies with the following constraint definition in the ``model`` settings: - -.. code-block:: yaml - - model: - group_share: - csp,cold_fusion: - carrier_prod_min: - power: 0.85 - -Possible ``group_share`` constraints with carrier-specific settings are: - -* ``carrier_prod_min`` -* ``carrier_prod_max`` -* ``carrier_prod_equals`` - -Possible ``group_share`` constraints with carrier-independent settings are: - -* ``flow_cap_min`` -* ``flow_cap_max`` -* ``flow_cap_equals`` - -These can be implemented as, for example, to force at most 20% of ``flow_cap`` to come from the two listed technologies: - -.. code-block:: yaml - - model: - group_share: - csp,cold_fusion: - flow_cap_max: 0.20 - ------------------------------------ Binary and mixed-integer constraints ------------------------------------ @@ -323,7 +282,7 @@ Calliope models are purely linear by default. However, several constraints can t By applying a ``purchase`` cost to a technology, that technology will have a binary variable associated with it, describing whether or not it has been "purchased". -By applying ``units.max``, ``units.min``, or ``units.equals`` to a technology, that technology will have a integer variable associated with it, describing how many of that technology have been "purchased". If a ``purchase`` cost has been applied to this same technology, the purchasing cost will be applied per unit. +By applying ``units_max`` or ``units_min`` to a technology, that technology will have a integer variable associated with it, describing how many of that technology have been "purchased". If a ``purchase`` cost has been applied to this same technology, the purchasing cost will be applied per unit. .. Warning:: diff --git a/src/calliope/config/math_schema.yaml b/src/calliope/config/math_schema.yaml index e88a86de7..1fc4555c9 100644 --- a/src/calliope/config/math_schema.yaml +++ b/src/calliope/config/math_schema.yaml @@ -139,12 +139,6 @@ properties: max: type: [string, number] description: Decision variable upper bound, either as a reference to an input parameter or as a number. - equals: - type: [string, number] - description: Decision variable equality bound, either as a reference to an input parameter or as a number, which simultanously forces the lower and uppere bound to the same value. - scale: - type: [string, number] - description: Scaling factor, either as a reference to an input parameter or as a number, which will be applied to all bounds. objectives: type: object diff --git a/src/calliope/preprocess/checks.py b/src/calliope/preprocess/checks.py index 45430fa15..f38c189c7 100644 --- a/src/calliope/preprocess/checks.py +++ b/src/calliope/preprocess/checks.py @@ -435,7 +435,7 @@ def _check_tech_final( ): errors.append( f"`{tech_id}` at `{loc_id}` fails to define flow_cap_per_unit when " - "specifying technology in units_max/min/equals" + "specifying technology in units_max/min" ) # If a technology is defined by units & is a storage tech, it must define storage_cap_per_unit @@ -447,7 +447,7 @@ def _check_tech_final( ): errors.append( f"`{tech_id}` at `{loc_id}` fails to define storage_cap_per_unit when " - "specifying technology in units_max/min/equals" + "specifying technology in units_max/min" ) # Gather remaining unallowed constraints