corrections

This commit is contained in:
egarette@silique.fr 2024-08-08 11:41:03 +02:00
parent 3f378194ba
commit eeee06ad92
36 changed files with 259 additions and 285 deletions

View file

@ -397,11 +397,9 @@ class _VariableCalculation(Calculation):
propertyerror: bool = True
allow_none: bool = False
def get_params(
self,
objectspace,
needs_multi: Optional[bool] = None,
):
def get_variable(self,
objectspace,
) -> "Variable":
if self.ori_path is None:
path = self.path
else:
@ -414,13 +412,22 @@ class _VariableCalculation(Calculation):
self.namespace,
self.xmlfiles,
)
if not 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):
if variable and not isinstance(variable, objectspace.variable):
# FIXME remove the pfff
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 = {
"type": "variable",
"variable": variable,
@ -477,11 +484,17 @@ class VariableCalculation(_VariableCalculation):
self,
objectspace,
) -> dict:
params = self.get_params(objectspace)
if self.attribute_name == "choices":
if hasattr(self, "optional") and self.optional is True:
msg = "'choices' variable shall not have an 'optional' atttibute"
raise DictConsistencyError(msg, 33, self.xmlfiles)
if self.attribute_name != "default" and self.optional is True:
msg = f'"{self.attribute_name}" variable shall not have an "optional" attribute for variable "{self.variable}"'
raise DictConsistencyError(msg, 33, self.xmlfiles)
variable, suffix = self.get_variable(objectspace)
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 {
"function": "calc_value",
"params": params,
@ -497,7 +510,11 @@ class VariablePropertyCalculation(_VariableCalculation):
self,
objectspace,
) -> 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"]
if self.when is not undefined:
if self.version == "1.0":

View file

@ -409,7 +409,10 @@ class Common:
params = []
for idx, data in enumerate(datas):
if isinstance(data, Calculation):
params.append(self.calculation_value(data))
try:
params.append(self.calculation_value(data))
except VariableCalculationDependencyError:
pass
elif isinstance(data, str):
params.append(self.convert_str(data))
else:
@ -452,12 +455,6 @@ class Variable(Common):
)
return
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(
self.elt.choices, return_a_tuple=True
)
@ -468,17 +465,13 @@ class Variable(Common):
keys["default"] = self.populate_calculation(self.elt.default)
except VariableCalculationDependencyError:
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:
keys["default_multi"] = self.populate_calculation(
self.objectspace.default_multi[self.elt.path]
)
try:
keys["default_multi"] = self.populate_calculation(
self.objectspace.default_multi[self.elt.path]
)
except VariableCalculationDependencyError:
pass
if self.elt.validators:
keys["validators"] = self.populate_calculation(self.elt.validators)
for key, value in (

View file

@ -7,7 +7,7 @@ my_variable:
type: choice
choices:
- type: variable
variable: rougail.source_variable_1
variable: _.source_variable_1
- type: variable
variable: rougail.source_variable_2
variable: _.source_variable_2
default: val1

View file

@ -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])

View file

@ -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

View file

@ -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])

View file

@ -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])

View file

@ -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])

View file

@ -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

View file

@ -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])

View file

@ -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])

View file

@ -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])

View file

@ -1,14 +1,8 @@
---
version: 1.1
#my_variable:
# multi: true
# default:
# - val1
# - val2
my_calculated_variable:
multi: true
default:
type: variable
variable: rougail.my_variable
variable: _.my_variable
optional: true

View file

@ -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])

View file

@ -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])

View file

@ -1,16 +1,9 @@
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")
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_calculated_variable",
doc="my_calculated_variable",
multi=True,
properties=frozenset({"mandatory", "notempty", "standard"}),
informations={"type": "string"},
)
option_1 = 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])

View file

@ -9,6 +9,5 @@ my_calculated_variable:
multi: true
default:
type: variable
variable: rougail.my_variable
variable: _.my_variable
optional: true

View file

@ -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])

View file

@ -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])

View file

@ -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])

View file

@ -0,0 +1,11 @@
---
version: '1.1'
var1:
- a
- b
- c
var2:
choices:
type: variable
variable: _.var1
optional: true

View 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

View file

@ -1,27 +1,16 @@
general:
mode_conteneur_actif:
type: choice
description: No change
default: a
choices:
---
version: '1.1'
var:
- a
- b
- c
var2:
- a
- b
- c
var3:
choices:
- type: variable
variable: rougail.general.var
variable: _.var
- type: variable
variable: rougail.general.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'
variable: _.var2

View file

@ -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]
)

View file

@ -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],
)

View file

@ -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]
)

View file

@ -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],
)

View file

@ -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]
)