From 22fdabb6c0e66873dbada8556a3beb8456cb9e22 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Wed, 11 Dec 2024 21:57:46 +0100 Subject: [PATCH] fix: option.get now accept allow_dynoption --- tiramisu/api.py | 7 ++++--- tiramisu/autolib.py | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tiramisu/api.py b/tiramisu/api.py index 7a4f11b..c982377 100644 --- a/tiramisu/api.py +++ b/tiramisu/api.py @@ -139,6 +139,8 @@ def option_type(typ): @wraps(func) def wrapped(*args, **kwargs): self = args[0] + if isinstance(typ, list) and "allow_dynoption" in typ: + self._allow_dynoption = True config_bag = self._config_bag if self._config_bag.context.impl_type == "group" and "group" in types: options_bag = [ @@ -269,10 +271,9 @@ class _TiramisuOptionWalk: class _TiramisuOptionOptionDescription: """Manage option""" - _validate_properties = False - @option_type(["optiondescription", "option", "with_or_without_index", "symlink"]) + @option_type(["optiondescription", "option", "with_or_without_index", "symlink", "allow_dynoption"]) def get(self): """Get Tiramisu option""" return self._subconfig.option @@ -1527,7 +1528,7 @@ class TiramisuContextOption(TiramisuConfig, _TiramisuOptionWalk): def get(self): """Get Tiramisu option""" - return None + return self._config_bag.context.get_description() def isleadership(self): """Test if option is a leader or a follower""" diff --git a/tiramisu/autolib.py b/tiramisu/autolib.py index 3588f04..a7541fb 100644 --- a/tiramisu/autolib.py +++ b/tiramisu/autolib.py @@ -602,6 +602,9 @@ def manager_callback( "option {0} is not a dynoptiondescription or in a dynoptiondescription" ).format(display_name) ) + if subconfig.identifiers is None: + # if uncalculated + return return subconfig.identifiers[param.identifier_index] if isinstance(param, ParamSelfOption):