Feat: random expression generator is working
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from ...core.tree import MutableTree, Tree
|
||||
from ...core.MO import moify
|
||||
from .grammar import extract_letters, eval_words
|
||||
from .generate import random_generator
|
||||
from .str2 import rdstr2
|
||||
@@ -97,9 +98,9 @@ class RandomTree(MutableTree):
|
||||
return leaf.replace(leaves_value)
|
||||
except AttributeError:
|
||||
return leaf
|
||||
return self.map_on_leaf(replace)
|
||||
return self.map_on_leaf(replace).map_on_leaf(moify)
|
||||
|
||||
def generate(self, conditions:list[str]=[], config:dict={} , configs:dict={}) -> Tree:
|
||||
def generate(self, conditions:list[str]=[], global_config:dict={} , configs:dict={}) -> Tree:
|
||||
""" Generate a random version of self
|
||||
|
||||
:param conditions: list of conditions
|
||||
@@ -107,6 +108,6 @@ class RandomTree(MutableTree):
|
||||
:param configs: specific configuration for each generated values
|
||||
|
||||
"""
|
||||
generated_values = random_generator(self.random_values, config, configs)
|
||||
generated_values = random_generator(self.random_value, conditions, global_config, configs)
|
||||
leaves = eval_words(self.random_leaves, generated_values)
|
||||
return self.eval_random_leaves(leaves)
|
||||
|
||||
Reference in New Issue
Block a user