add ParamIndex
This commit is contained in:
19
tests/dictionaries/01fill_target_optional/00-base.xml
Normal file
19
tests/dictionaries/01fill_target_optional/00-base.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<variables>
|
||||
<family name="general">
|
||||
<variable name="mode_conteneur_actif1" type="string" description="No change">
|
||||
<value>non</value>
|
||||
</variable>
|
||||
</family>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
<fill name="calc_val">
|
||||
<param type="variable">mode_conteneur_actif1</param>
|
||||
<target optional="True">mode_conteneur_actif</target>
|
||||
</fill>
|
||||
</constraints>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
@ -0,0 +1 @@
|
||||
{"rougail.general.mode_conteneur_actif1": "non"}
|
17
tests/dictionaries/01fill_target_optional/tiramisu/base.py
Normal file
17
tests/dictionaries/01fill_target_optional/tiramisu/base.py
Normal file
@ -0,0 +1,17 @@
|
||||
from importlib.machinery import SourceFileLoader
|
||||
from importlib.util import spec_from_loader, module_from_spec
|
||||
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
||||
spec = spec_from_loader(loader.name, loader)
|
||||
func = module_from_spec(spec)
|
||||
loader.exec_module(func)
|
||||
for key, value in dict(locals()).items():
|
||||
if key != ['SourceFileLoader', 'func']:
|
||||
setattr(func, key, value)
|
||||
try:
|
||||
from tiramisu3 import *
|
||||
except:
|
||||
from tiramisu import *
|
||||
option_3 = StrOption(name="mode_conteneur_actif1", doc="No change", default="non", properties=frozenset({"mandatory", "normal"}))
|
||||
option_2 = OptionDescription(name="general", doc="general", children=[option_3], properties=frozenset({"normal"}))
|
||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
15
tests/dictionaries/10check_base_target_optional/00-base.xml
Normal file
15
tests/dictionaries/10check_base_target_optional/00-base.xml
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<variables>
|
||||
<variable name="my_variable"/>
|
||||
</variables>
|
||||
<constraints>
|
||||
<check name="valid_entier">
|
||||
<param name="mini" type="number">0</param>
|
||||
<param name="maxi" type="number">100</param>
|
||||
<target optional="True">int</target>
|
||||
</check>
|
||||
</constraints>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
@ -0,0 +1 @@
|
||||
{"rougail.my_variable": null}
|
@ -0,0 +1,16 @@
|
||||
from importlib.machinery import SourceFileLoader
|
||||
from importlib.util import spec_from_loader, module_from_spec
|
||||
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
||||
spec = spec_from_loader(loader.name, loader)
|
||||
func = module_from_spec(spec)
|
||||
loader.exec_module(func)
|
||||
for key, value in dict(locals()).items():
|
||||
if key != ['SourceFileLoader', 'func']:
|
||||
setattr(func, key, value)
|
||||
try:
|
||||
from tiramisu3 import *
|
||||
except:
|
||||
from tiramisu import *
|
||||
option_2 = StrOption(name="my_variable", doc="my_variable", properties=frozenset({"normal"}))
|
||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
21
tests/dictionaries/10leadership_auto_index/00-base.xml
Normal file
21
tests/dictionaries/10leadership_auto_index/00-base.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<variables>
|
||||
<variable name="leader" multi="True">
|
||||
<value>a</value>
|
||||
<value>b</value>
|
||||
<value>c</value>
|
||||
</variable>
|
||||
<variable name="follower1" type="number"/>
|
||||
</variables>
|
||||
|
||||
<constraints>
|
||||
<fill name="calc_val">
|
||||
<param type="index"/>
|
||||
<target>follower1</target>
|
||||
</fill>
|
||||
<group leader="leader">
|
||||
<follower>follower1</follower>
|
||||
</group>
|
||||
</constraints>
|
||||
</rougail>
|
@ -0,0 +1 @@
|
||||
{"rougail.leader.leader": [{"rougail.leader.leader": "a", "rougail.leader.follower1": 0}, {"rougail.leader.leader": "b", "rougail.leader.follower1": 1}, {"rougail.leader.leader": "c", "rougail.leader.follower1": 2}]}
|
18
tests/dictionaries/10leadership_auto_index/tiramisu/base.py
Normal file
18
tests/dictionaries/10leadership_auto_index/tiramisu/base.py
Normal file
@ -0,0 +1,18 @@
|
||||
from importlib.machinery import SourceFileLoader
|
||||
from importlib.util import spec_from_loader, module_from_spec
|
||||
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
||||
spec = spec_from_loader(loader.name, loader)
|
||||
func = module_from_spec(spec)
|
||||
loader.exec_module(func)
|
||||
for key, value in dict(locals()).items():
|
||||
if key != ['SourceFileLoader', 'func']:
|
||||
setattr(func, key, value)
|
||||
try:
|
||||
from tiramisu3 import *
|
||||
except:
|
||||
from tiramisu import *
|
||||
option_3 = StrOption(name="leader", doc="leader", multi=True, default=['a', 'b', 'c'], properties=frozenset({"mandatory"}))
|
||||
option_4 = IntOption(name="follower1", doc="follower1", multi=True, default=Calculation(func.calc_val, Params((ParamIndex()))), properties=frozenset({"normal"}))
|
||||
option_2 = Leadership(name="leader", doc="leader", children=[option_3, option_4], properties=frozenset({"normal"}))
|
||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
12
tests/dictionaries/45multi_family_expert/00-base.xml
Normal file
12
tests/dictionaries/45multi_family_expert/00-base.xml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<rougail>
|
||||
<variables>
|
||||
<family name="base" mode="expert">
|
||||
<family name="subfamily">
|
||||
<variable name="variable"/>
|
||||
</family>
|
||||
</family>
|
||||
</variables>
|
||||
</rougail>
|
||||
<!-- vim: ts=4 sw=4 expandtab
|
||||
-->
|
@ -0,0 +1 @@
|
||||
{"rougail.base.subfamily.variable": null}
|
18
tests/dictionaries/45multi_family_expert/tiramisu/base.py
Normal file
18
tests/dictionaries/45multi_family_expert/tiramisu/base.py
Normal file
@ -0,0 +1,18 @@
|
||||
from importlib.machinery import SourceFileLoader
|
||||
from importlib.util import spec_from_loader, module_from_spec
|
||||
loader = SourceFileLoader('func', 'tests/dictionaries/../eosfunc/test.py')
|
||||
spec = spec_from_loader(loader.name, loader)
|
||||
func = module_from_spec(spec)
|
||||
loader.exec_module(func)
|
||||
for key, value in dict(locals()).items():
|
||||
if key != ['SourceFileLoader', 'func']:
|
||||
setattr(func, key, value)
|
||||
try:
|
||||
from tiramisu3 import *
|
||||
except:
|
||||
from tiramisu import *
|
||||
option_4 = StrOption(name="variable", doc="variable", properties=frozenset({"expert"}))
|
||||
option_3 = OptionDescription(name="subfamily", doc="subfamily", children=[option_4], properties=frozenset({"expert"}))
|
||||
option_2 = OptionDescription(name="base", doc="base", children=[option_3], properties=frozenset({"expert"}))
|
||||
option_1 = OptionDescription(name="rougail", doc="rougail", children=[option_2])
|
||||
option_0 = OptionDescription(name="baseoption", doc="baseoption", children=[option_1])
|
@ -60,3 +60,7 @@ def device_type(*args, **kwargs):
|
||||
|
||||
def calc_list(*args, **kwargs):
|
||||
return list(args)
|
||||
|
||||
|
||||
def test_index(index):
|
||||
return index
|
||||
|
Reference in New Issue
Block a user