Skip to content

Commit 19c9b71

Browse files
committed
Enable customisation of constraints
1 parent 9938ba9 commit 19c9b71

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/muse/constraints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def factory(
225225
"""
226226
from functools import partial
227227

228-
if settings is None:
228+
if not settings:
229229
settings = (
230230
"max_production",
231231
"max_capacity_expansion",

src/muse/data/example/default/settings.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ constraints = [
5959
"max_production",
6060
"max_capacity_expansion",
6161
"demand",
62-
"search_space"
62+
"search_space",
63+
"minimum_service"
6364
]
6465
demand_share = "new_and_retro" # Optional, default to new_and_retro
6566
forecast = 5 # Optional, defaults to 5

src/muse/data/example/default_timeslice/settings.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ constraints = [
6161
"max_production",
6262
"max_capacity_expansion",
6363
"demand",
64-
"search_space"
64+
"search_space",
65+
"minimum_service"
6566
]
6667
demand_share = "new_and_retro" # Optional, default to new_and_retro
6768
forecast = 5 # Optional, defaults to 5

src/muse/sectors/subsector.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ def factory(
191191
# only used by self-investing agents
192192
investment=getattr(settings, "lpsolver", "adhoc"),
193193
forecast=getattr(settings, "forecast", 5),
194+
constraints=getattr(settings, "constraints", ()),
194195
)
195196
# technologies can have nans where a commodity
196197
# does not apply to a technology at all

0 commit comments

Comments
 (0)