diff --git a/doc/user/advanced_constraints.rst b/doc/user/advanced_constraints.rst index f310eddc0..66444dd3a 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 8779ef2f5..dc03d83a4 100644 --- a/src/calliope/preprocess/checks.py +++ b/src/calliope/preprocess/checks.py @@ -370,7 +370,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 @@ -382,7 +382,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 diff --git a/tests/test_backend_pyomo.py b/tests/test_backend_pyomo.py index da8bb9cd6..4f66d96d6 100755 --- a/tests/test_backend_pyomo.py +++ b/tests/test_backend_pyomo.py @@ -3,12 +3,13 @@ from copy import deepcopy from itertools import product -import calliope.exceptions as exceptions import numpy as np import pandas as pd import pyomo.kernel as pmo import pytest # noqa: F401 import xarray as xr + +import calliope.exceptions as exceptions from calliope.backend.pyomo_backend_model import PyomoBackendModel from calliope.core.attrdict import AttrDict