From 55b86967957e6d57f163c3dacac2a7f289571844 Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Thu, 2 Nov 2023 22:13:26 +0100 Subject: [PATCH] Set defaults for --nodes and --years --- message_ix_models/util/click.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/message_ix_models/util/click.py b/message_ix_models/util/click.py index 037e79f59d..f9568aab79 100644 --- a/message_ix_models/util/click.py +++ b/message_ix_models/util/click.py @@ -10,7 +10,7 @@ import click from click import Argument, Choice, Option -from message_ix_models import Context +from message_ix_models import Context, model from message_ix_models.model.structure import codelists from .scenarioinfo import ScenarioInfo @@ -189,6 +189,7 @@ def unique_id() -> str: help="Code list to use for 'node' dimension.", callback=exec_cb("context.model.regions = value"), type=Choice(codelists("node")), + default=model.Config.regions, expose_value=False, ), "output_model": Option( @@ -254,6 +255,9 @@ def unique_id() -> str: "years": Option( ["--years"], help="Code list to use for the 'year' dimension.", + callback=exec_cb("context.model.years = value"), type=Choice(codelists("year")), + default=model.Config.years, + # expose_value=False, ), }