intermediate commit

This commit is contained in:
2024-09-22 09:27:20 +02:00
parent a729d98a0d
commit 3be854d34c
14 changed files with 441 additions and 108 deletions
+11 -8
View File
@@ -45,7 +45,8 @@ def get_concept(name=None, body=None,
is_builtin=False,
is_unique=False,
autouse=False,
sequence=None) -> Concept:
sequence=None,
init_parameters=True) -> Concept:
"""
Create a Concept objet
Caution : 'id' and 'key' are not initialized
@@ -115,6 +116,10 @@ def get_concept(name=None, body=None,
else:
metadata.digest = ConceptManager.compute_metadata_digest(metadata)
metadata.all_attrs = ConceptManager.compute_all_attrs(metadata.variables)
if init_parameters and metadata.variables:
metadata.parameters = [v[0] if isinstance(v, tuple) else v for v in metadata.variables]
return Concept(metadata)
@@ -355,13 +360,11 @@ def get_concepts(context: ExecutionContext, *concepts, **kwargs) -> list[Concept
"""
Simple and quick way to get initialize concepts for a test
:param context:
:type context:
:param concepts:
:type concepts:
:param kwargs:
:type kwargs:
:return:
:rtype:
:param concepts: Concepts to create
:param kwargs: named parameters to tweak the creation of the concepts
use_sheerka : Adds the new concepts to Sheerka. If not simply creates concepts that do not affect Sheerka
sequence : Sequence Manager, to give a correct id to the created concepts
:return: the concepts
"""
res = []
use_sheerka = kwargs.pop("use_sheerka", False)