corrections
This commit is contained in:
parent
3f378194ba
commit
eeee06ad92
36 changed files with 259 additions and 285 deletions
|
@ -397,11 +397,9 @@ class _VariableCalculation(Calculation):
|
||||||
propertyerror: bool = True
|
propertyerror: bool = True
|
||||||
allow_none: bool = False
|
allow_none: bool = False
|
||||||
|
|
||||||
def get_params(
|
def get_variable(self,
|
||||||
self,
|
objectspace,
|
||||||
objectspace,
|
) -> "Variable":
|
||||||
needs_multi: Optional[bool] = None,
|
|
||||||
):
|
|
||||||
if self.ori_path is None:
|
if self.ori_path is None:
|
||||||
path = self.path
|
path = self.path
|
||||||
else:
|
else:
|
||||||
|
@ -414,13 +412,22 @@ class _VariableCalculation(Calculation):
|
||||||
self.namespace,
|
self.namespace,
|
||||||
self.xmlfiles,
|
self.xmlfiles,
|
||||||
)
|
)
|
||||||
if not variable:
|
if variable and not isinstance(variable, objectspace.variable):
|
||||||
if self.optional:
|
|
||||||
msg = f'the dependent variable was not found "{self.optional}" for variable "{self.path}"'
|
|
||||||
raise VariableCalculationDependencyError(msg, 90, self.xmlfiles)
|
|
||||||
if not isinstance(variable, objectspace.variable):
|
|
||||||
# FIXME remove the pfff
|
# FIXME remove the pfff
|
||||||
raise Exception("pfff it's a family")
|
raise Exception("pfff it's a family")
|
||||||
|
return variable, suffix
|
||||||
|
|
||||||
|
def get_params(
|
||||||
|
self,
|
||||||
|
objectspace,
|
||||||
|
variable: "Variable",
|
||||||
|
suffix: Optional[str],
|
||||||
|
*,
|
||||||
|
needs_multi: Optional[bool] = None,
|
||||||
|
):
|
||||||
|
if not variable:
|
||||||
|
msg = f'Variable not found "{self.variable}" for attribut "{self.attribute_name}" for variable "{self.path}"'
|
||||||
|
raise DictConsistencyError(msg, 88, self.xmlfiles)
|
||||||
param = {
|
param = {
|
||||||
"type": "variable",
|
"type": "variable",
|
||||||
"variable": variable,
|
"variable": variable,
|
||||||
|
@ -477,11 +484,17 @@ class VariableCalculation(_VariableCalculation):
|
||||||
self,
|
self,
|
||||||
objectspace,
|
objectspace,
|
||||||
) -> dict:
|
) -> dict:
|
||||||
params = self.get_params(objectspace)
|
if self.attribute_name != "default" and self.optional is True:
|
||||||
if self.attribute_name == "choices":
|
msg = f'"{self.attribute_name}" variable shall not have an "optional" attribute for variable "{self.variable}"'
|
||||||
if hasattr(self, "optional") and self.optional is True:
|
raise DictConsistencyError(msg, 33, self.xmlfiles)
|
||||||
msg = "'choices' variable shall not have an 'optional' atttibute"
|
variable, suffix = self.get_variable(objectspace)
|
||||||
raise DictConsistencyError(msg, 33, self.xmlfiles)
|
if not variable and self.optional:
|
||||||
|
msg = f'the dependent variable was not found "{self.optional}" for attribute "{self.attribute_name}" in variable "{self.path}"'
|
||||||
|
raise VariableCalculationDependencyError(msg, 90, self.xmlfiles)
|
||||||
|
params = self.get_params(objectspace,
|
||||||
|
variable,
|
||||||
|
suffix,
|
||||||
|
)
|
||||||
return {
|
return {
|
||||||
"function": "calc_value",
|
"function": "calc_value",
|
||||||
"params": params,
|
"params": params,
|
||||||
|
@ -497,7 +510,11 @@ class VariablePropertyCalculation(_VariableCalculation):
|
||||||
self,
|
self,
|
||||||
objectspace,
|
objectspace,
|
||||||
) -> dict:
|
) -> dict:
|
||||||
params = self.get_params(objectspace, False)
|
variable, suffix = self.get_variable(objectspace)
|
||||||
|
params = self.get_params(objectspace,
|
||||||
|
variable,
|
||||||
|
suffix,
|
||||||
|
needs_multi=False,)
|
||||||
variable = params[None][0]["variable"]
|
variable = params[None][0]["variable"]
|
||||||
if self.when is not undefined:
|
if self.when is not undefined:
|
||||||
if self.version == "1.0":
|
if self.version == "1.0":
|
||||||
|
|
|
@ -409,7 +409,10 @@ class Common:
|
||||||
params = []
|
params = []
|
||||||
for idx, data in enumerate(datas):
|
for idx, data in enumerate(datas):
|
||||||
if isinstance(data, Calculation):
|
if isinstance(data, Calculation):
|
||||||
params.append(self.calculation_value(data))
|
try:
|
||||||
|
params.append(self.calculation_value(data))
|
||||||
|
except VariableCalculationDependencyError:
|
||||||
|
pass
|
||||||
elif isinstance(data, str):
|
elif isinstance(data, str):
|
||||||
params.append(self.convert_str(data))
|
params.append(self.convert_str(data))
|
||||||
else:
|
else:
|
||||||
|
@ -452,12 +455,6 @@ class Variable(Common):
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
if self.elt.type == "choice":
|
if self.elt.type == "choice":
|
||||||
# TODO : 'optional' sub-attriute shall be forbidden
|
|
||||||
# raise DictConsistencyError(
|
|
||||||
# "Sub-attributes not allowed in a 'choices' attribute",
|
|
||||||
# 100,
|
|
||||||
# self.elt.xmlfiles,
|
|
||||||
# )
|
|
||||||
keys["values"] = self.populate_calculation(
|
keys["values"] = self.populate_calculation(
|
||||||
self.elt.choices, return_a_tuple=True
|
self.elt.choices, return_a_tuple=True
|
||||||
)
|
)
|
||||||
|
@ -468,17 +465,13 @@ class Variable(Common):
|
||||||
keys["default"] = self.populate_calculation(self.elt.default)
|
keys["default"] = self.populate_calculation(self.elt.default)
|
||||||
except VariableCalculationDependencyError:
|
except VariableCalculationDependencyError:
|
||||||
pass
|
pass
|
||||||
# for attribute in ["frozen", "hidden", "mandatory", "disabled"]:
|
|
||||||
# if hasattr(self.elt, attribute): # FIXME FIXME and attribute == "optional":
|
|
||||||
# raise DictConsistencyError(
|
|
||||||
# f"Sub-attributes not allowed in a '{attribute}' attribute",
|
|
||||||
# 100,
|
|
||||||
# self.elt.xmlfiles,
|
|
||||||
# )
|
|
||||||
if self.elt.path in self.objectspace.default_multi:
|
if self.elt.path in self.objectspace.default_multi:
|
||||||
keys["default_multi"] = self.populate_calculation(
|
try:
|
||||||
self.objectspace.default_multi[self.elt.path]
|
keys["default_multi"] = self.populate_calculation(
|
||||||
)
|
self.objectspace.default_multi[self.elt.path]
|
||||||
|
)
|
||||||
|
except VariableCalculationDependencyError:
|
||||||
|
pass
|
||||||
if self.elt.validators:
|
if self.elt.validators:
|
||||||
keys["validators"] = self.populate_calculation(self.elt.validators)
|
keys["validators"] = self.populate_calculation(self.elt.validators)
|
||||||
for key, value in (
|
for key, value in (
|
||||||
|
|
|
@ -7,7 +7,7 @@ my_variable:
|
||||||
type: choice
|
type: choice
|
||||||
choices:
|
choices:
|
||||||
- type: variable
|
- type: variable
|
||||||
variable: rougail.source_variable_1
|
variable: _.source_variable_1
|
||||||
- type: variable
|
- type: variable
|
||||||
variable: rougail.source_variable_2
|
variable: _.source_variable_2
|
||||||
default: val1
|
default: val1
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_1 = StrOption(name="source_variable_1", doc="the first source variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_2 = StrOption(name="source_variable_2", doc="the second source variable", default="val2", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_3 = ChoiceOption(name="my_variable", doc="a variable", values=(Calculation(func['calc_value'], Params((ParamOption(option_1)))), Calculation(func['calc_value'], Params((ParamOption(option_2))))), default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'choice'})
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2, option_3])
|
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
my_variable:
|
||||||
|
default: val1
|
||||||
|
my_calculated_variable:
|
||||||
|
multi: true
|
||||||
|
default:
|
||||||
|
- type: variable
|
||||||
|
variable: _.my_variable
|
||||||
|
optional: true
|
||||||
|
- type: variable
|
||||||
|
variable: _.my_variable_unexists
|
||||||
|
optional: true
|
|
@ -0,0 +1,11 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_2 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_3 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_2))))], default_multi=Calculation(func['calc_value'], Params((ParamOption(option_2)))), properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,16 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_3))))], default_multi=Calculation(func['calc_value'], Params((ParamOption(option_3)))), properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_7 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_7))))], default_multi=Calculation(func['calc_value'], Params((ParamOption(option_7)))), properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
|
@ -0,0 +1,10 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_1 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_2 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_1))))], default_multi=Calculation(func['calc_value'], Params((ParamOption(option_1)))), properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
version: 1.1
|
||||||
|
my_variable:
|
||||||
|
default: val1
|
||||||
|
my_calculated_variable:
|
||||||
|
multi: true
|
||||||
|
default:
|
||||||
|
- type: variable
|
||||||
|
variable: _.my_variable_unexists
|
||||||
|
optional: true
|
||||||
|
- type: variable
|
||||||
|
variable: _.my_variable
|
||||||
|
optional: true
|
|
@ -0,0 +1,11 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_2 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_3 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_2))))], properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,16 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_3))))], properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_7 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_7))))], properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
|
@ -0,0 +1,10 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_1 = StrOption(name="my_variable", doc="my_variable", default="val1", properties=frozenset({"mandatory", "standard"}), informations={'type': 'string'})
|
||||||
|
option_2 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=[Calculation(func['calc_value'], Params((ParamOption(option_1))))], properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
|
@ -1,14 +1,8 @@
|
||||||
---
|
---
|
||||||
version: 1.1
|
version: 1.1
|
||||||
#my_variable:
|
|
||||||
# multi: true
|
|
||||||
# default:
|
|
||||||
# - val1
|
|
||||||
# - val2
|
|
||||||
my_calculated_variable:
|
my_calculated_variable:
|
||||||
multi: true
|
multi: true
|
||||||
default:
|
default:
|
||||||
type: variable
|
type: variable
|
||||||
variable: rougail.my_variable
|
variable: _.my_variable
|
||||||
optional: true
|
optional: true
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_2 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,14 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", children=[option_3], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_6 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_5 = OptionDescription(name="rougail", doc="Rougail", children=[option_6], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_4 = OptionDescription(name="2", doc="2", children=[optiondescription_5], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_4])
|
|
@ -1,16 +1,9 @@
|
||||||
from tiramisu import *
|
from tiramisu import *
|
||||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
load_functions("tests/dictionaries/../eosfunc/test.py")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
option_1 = StrOption(
|
option_1 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
name="my_calculated_variable",
|
|
||||||
doc="my_calculated_variable",
|
|
||||||
multi=True,
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
|
@ -9,6 +9,5 @@ my_calculated_variable:
|
||||||
multi: true
|
multi: true
|
||||||
default:
|
default:
|
||||||
type: variable
|
type: variable
|
||||||
variable: rougail.my_variable
|
variable: _.my_variable
|
||||||
optional: true
|
optional: true
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_2 = StrOption(name="my_variable", doc="my_variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
option_3 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_2)))), properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_1 = OptionDescription(name="rougail", doc="Rougail", children=[option_2, option_3], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1])
|
|
@ -0,0 +1,16 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_3 = StrOption(name="my_variable", doc="my_variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
option_4 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_3)))), properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_2 = OptionDescription(name="rougail", doc="Rougail", children=[option_3, option_4], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_1 = OptionDescription(name="1", doc="1", children=[optiondescription_2], properties=frozenset({"standard"}))
|
||||||
|
option_7 = StrOption(name="my_variable", doc="my_variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
option_8 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_7)))), properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
optiondescription_6 = OptionDescription(name="rougail", doc="Rougail", children=[option_7, option_8], properties=frozenset({"standard"}))
|
||||||
|
optiondescription_5 = OptionDescription(name="2", doc="2", children=[optiondescription_6], properties=frozenset({"standard"}))
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[optiondescription_1, optiondescription_5])
|
|
@ -0,0 +1,10 @@
|
||||||
|
from tiramisu import *
|
||||||
|
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
||||||
|
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
||||||
|
load_functions('tests/dictionaries/../eosfunc/test.py')
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("basic")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("standard")
|
||||||
|
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
||||||
|
option_1 = StrOption(name="my_variable", doc="my_variable", multi=True, default=["val1", "val2"], default_multi="val1", properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
option_2 = StrOption(name="my_calculated_variable", doc="my_calculated_variable", multi=True, default=Calculation(func['calc_value'], Params((ParamOption(option_1)))), properties=frozenset({"mandatory", "notempty", "standard"}), informations={'type': 'string'})
|
||||||
|
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1, option_2])
|
|
@ -0,0 +1,11 @@
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
var1:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
- c
|
||||||
|
var2:
|
||||||
|
choices:
|
||||||
|
type: variable
|
||||||
|
variable: _.var1
|
||||||
|
optional: true
|
0
tests/dictionaries/80choice_variable_optional/errno_33
Normal file
0
tests/dictionaries/80choice_variable_optional/errno_33
Normal file
0
tests/dictionaries/80family_dynamic_optional/__init__.py
Normal file
0
tests/dictionaries/80family_dynamic_optional/__init__.py
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
---
|
||||||
|
version: '1.1'
|
||||||
|
varname:
|
||||||
|
default:
|
||||||
|
- val1
|
||||||
|
dyn{{ suffix }}:
|
||||||
|
type: dynamic
|
||||||
|
dynamic:
|
||||||
|
type: variable
|
||||||
|
variable: _.varname
|
||||||
|
optional: true
|
||||||
|
vardyn:
|
||||||
|
type: string
|
0
tests/dictionaries/80family_dynamic_optional/errno_33
Normal file
0
tests/dictionaries/80family_dynamic_optional/errno_33
Normal file
|
@ -1,27 +1,16 @@
|
||||||
general:
|
---
|
||||||
mode_conteneur_actif:
|
version: '1.1'
|
||||||
type: choice
|
var:
|
||||||
description: No change
|
- a
|
||||||
default: a
|
- b
|
||||||
choices:
|
- c
|
||||||
|
var2:
|
||||||
|
- a
|
||||||
|
- b
|
||||||
|
- c
|
||||||
|
var3:
|
||||||
|
choices:
|
||||||
- type: variable
|
- type: variable
|
||||||
variable: rougail.general.var
|
variable: _.var
|
||||||
- type: variable
|
- type: variable
|
||||||
variable: rougail.general.var2
|
variable: _.var2
|
||||||
var:
|
|
||||||
type: string
|
|
||||||
description: New variable
|
|
||||||
multi: true
|
|
||||||
default:
|
|
||||||
- a
|
|
||||||
- b
|
|
||||||
- c
|
|
||||||
var2:
|
|
||||||
type: string
|
|
||||||
description: New variable
|
|
||||||
multi: true
|
|
||||||
default:
|
|
||||||
- a
|
|
||||||
- b
|
|
||||||
- c
|
|
||||||
version: '1.0'
|
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
from tiramisu import *
|
|
||||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
|
||||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
|
||||||
|
|
||||||
load_functions("tests/dictionaries/../eosfunc/test.py")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
option_2 = StrOption(
|
|
||||||
name="my_calculated_variable",
|
|
||||||
doc="my_calculated_variable",
|
|
||||||
multi=True,
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
optiondescription_1 = OptionDescription(
|
|
||||||
name="rougail",
|
|
||||||
doc="Rougail",
|
|
||||||
children=[option_2],
|
|
||||||
properties=frozenset({"standard"}),
|
|
||||||
)
|
|
||||||
option_0 = OptionDescription(
|
|
||||||
name="baseoption", doc="baseoption", children=[optiondescription_1]
|
|
||||||
)
|
|
|
@ -1,51 +0,0 @@
|
||||||
from tiramisu import *
|
|
||||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
|
||||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
|
||||||
|
|
||||||
load_functions("tests/dictionaries/../eosfunc/test.py")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
option_3 = StrOption(
|
|
||||||
name="my_calculated_variable",
|
|
||||||
doc="my_calculated_variable",
|
|
||||||
multi=True,
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
optiondescription_2 = OptionDescription(
|
|
||||||
name="rougail",
|
|
||||||
doc="Rougail",
|
|
||||||
children=[option_3],
|
|
||||||
properties=frozenset({"standard"}),
|
|
||||||
)
|
|
||||||
optiondescription_1 = OptionDescription(
|
|
||||||
name="1",
|
|
||||||
doc="1",
|
|
||||||
children=[optiondescription_2],
|
|
||||||
properties=frozenset({"standard"}),
|
|
||||||
)
|
|
||||||
option_6 = StrOption(
|
|
||||||
name="my_calculated_variable",
|
|
||||||
doc="my_calculated_variable",
|
|
||||||
multi=True,
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
optiondescription_5 = OptionDescription(
|
|
||||||
name="rougail",
|
|
||||||
doc="Rougail",
|
|
||||||
children=[option_6],
|
|
||||||
properties=frozenset({"standard"}),
|
|
||||||
)
|
|
||||||
optiondescription_4 = OptionDescription(
|
|
||||||
name="2",
|
|
||||||
doc="2",
|
|
||||||
children=[optiondescription_5],
|
|
||||||
properties=frozenset({"standard"}),
|
|
||||||
)
|
|
||||||
option_0 = OptionDescription(
|
|
||||||
name="baseoption",
|
|
||||||
doc="baseoption",
|
|
||||||
children=[optiondescription_1, optiondescription_4],
|
|
||||||
)
|
|
|
@ -1,34 +0,0 @@
|
||||||
from tiramisu import *
|
|
||||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
|
||||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
|
||||||
|
|
||||||
load_functions("tests/dictionaries/../eosfunc/test.py")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
option_2 = StrOption(
|
|
||||||
name="my_variable",
|
|
||||||
doc="my_variable",
|
|
||||||
multi=True,
|
|
||||||
default=["val1", "val2"],
|
|
||||||
default_multi="val1",
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
option_3 = StrOption(
|
|
||||||
name="my_calculated_variable",
|
|
||||||
doc="my_calculated_variable",
|
|
||||||
multi=True,
|
|
||||||
default=Calculation(func["calc_value"], Params((ParamOption(option_2)))),
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
optiondescription_1 = OptionDescription(
|
|
||||||
name="rougail",
|
|
||||||
doc="Rougail",
|
|
||||||
children=[option_2, option_3],
|
|
||||||
properties=frozenset({"standard"}),
|
|
||||||
)
|
|
||||||
option_0 = OptionDescription(
|
|
||||||
name="baseoption", doc="baseoption", children=[optiondescription_1]
|
|
||||||
)
|
|
|
@ -1,71 +0,0 @@
|
||||||
from tiramisu import *
|
|
||||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
|
||||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
|
||||||
|
|
||||||
load_functions("tests/dictionaries/../eosfunc/test.py")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
option_3 = StrOption(
|
|
||||||
name="my_variable",
|
|
||||||
doc="my_variable",
|
|
||||||
multi=True,
|
|
||||||
default=["val1", "val2"],
|
|
||||||
default_multi="val1",
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
option_4 = StrOption(
|
|
||||||
name="my_calculated_variable",
|
|
||||||
doc="my_calculated_variable",
|
|
||||||
multi=True,
|
|
||||||
default=Calculation(func["calc_value"], Params((ParamOption(option_3)))),
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
optiondescription_2 = OptionDescription(
|
|
||||||
name="rougail",
|
|
||||||
doc="Rougail",
|
|
||||||
children=[option_3, option_4],
|
|
||||||
properties=frozenset({"standard"}),
|
|
||||||
)
|
|
||||||
optiondescription_1 = OptionDescription(
|
|
||||||
name="1",
|
|
||||||
doc="1",
|
|
||||||
children=[optiondescription_2],
|
|
||||||
properties=frozenset({"standard"}),
|
|
||||||
)
|
|
||||||
option_7 = StrOption(
|
|
||||||
name="my_variable",
|
|
||||||
doc="my_variable",
|
|
||||||
multi=True,
|
|
||||||
default=["val1", "val2"],
|
|
||||||
default_multi="val1",
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
option_8 = StrOption(
|
|
||||||
name="my_calculated_variable",
|
|
||||||
doc="my_calculated_variable",
|
|
||||||
multi=True,
|
|
||||||
default=Calculation(func["calc_value"], Params((ParamOption(option_7)))),
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
optiondescription_6 = OptionDescription(
|
|
||||||
name="rougail",
|
|
||||||
doc="Rougail",
|
|
||||||
children=[option_7, option_8],
|
|
||||||
properties=frozenset({"standard"}),
|
|
||||||
)
|
|
||||||
optiondescription_5 = OptionDescription(
|
|
||||||
name="2",
|
|
||||||
doc="2",
|
|
||||||
children=[optiondescription_6],
|
|
||||||
properties=frozenset({"standard"}),
|
|
||||||
)
|
|
||||||
option_0 = OptionDescription(
|
|
||||||
name="baseoption",
|
|
||||||
doc="baseoption",
|
|
||||||
children=[optiondescription_1, optiondescription_5],
|
|
||||||
)
|
|
|
@ -1,27 +0,0 @@
|
||||||
from tiramisu import *
|
|
||||||
from tiramisu.setting import ALLOWED_LEADER_PROPERTIES
|
|
||||||
from rougail.tiramisu import func, dict_env, load_functions, ConvertDynOptionDescription
|
|
||||||
|
|
||||||
load_functions("tests/dictionaries/../eosfunc/test.py")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("basic")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("standard")
|
|
||||||
ALLOWED_LEADER_PROPERTIES.add("advanced")
|
|
||||||
option_1 = StrOption(
|
|
||||||
name="my_variable",
|
|
||||||
doc="my_variable",
|
|
||||||
multi=True,
|
|
||||||
default=["val1", "val2"],
|
|
||||||
default_multi="val1",
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
option_2 = StrOption(
|
|
||||||
name="my_calculated_variable",
|
|
||||||
doc="my_calculated_variable",
|
|
||||||
multi=True,
|
|
||||||
properties=frozenset({"mandatory", "notempty", "standard"}),
|
|
||||||
informations={"type": "string"},
|
|
||||||
)
|
|
||||||
option_0 = OptionDescription(
|
|
||||||
name="baseoption", doc="baseoption", children=[option_1, option_2]
|
|
||||||
)
|
|
Loading…
Reference in a new issue