Skip to content
Snippets Groups Projects
Commit 195e1020 authored by George Marchment's avatar George Marchment
Browse files

Update the extarct emits -> it wans't working correctly (it works on 404 and 314)

parent e45e1286
No related branches found
No related tags found
No related merge requests found
Pipeline #14472 failed with stage
in 2 minutes and 16 seconds
......@@ -75,7 +75,7 @@ class Emitted(Channel):
else:
if(thing_which_emits.get_type()=='Subworkflow'):
if(len(thing_which_emits.emit)!=1):
raise BioFlowInsightError(f"One channel was expected in the emit '{self.get_code()}'. Even though multiple emits are defined for the workflow '{self.emitted_by.get_name()}'", num=6, origin=self)
raise BioFlowInsightError(f"One channel was expected in the emit '{self.get_code()}'. Even though multiple emits are defined for the workflow '{self.emitted_by.get_first_element_called().get_name()}'", num=6, origin=self)
self.emits = thing_which_emits.emit[0]
else:
raise Exception("This shoudn't happen!")
......
......@@ -297,6 +297,30 @@ class Operation(Executor):
if(bool(re.fullmatch(r"\( *\w+ *(\, *\w+)+ *\) *= *Call_\d+", operation.strip()))):
raise BioFlowInsightError(f"A tuple is associated with an call{self.get_string_line(self.get_code(get_OG= True))}. BioFlow-Insight doesn't support this (see specification list), try defining the operation in a different way.", num=9, origin=self)
searching_for_emits = True
while(searching_for_emits):
searching_for_emits = False
stop_pattern_search = False
for pattern in [constant.EMIT_NAME, constant.EMIT_TAB, constant.EMIT_ALONE]:
for match in re.finditer(pattern, operation+" "):
try:
full_code, name_called, name_emitted = match.group(0), match.group(1), match.group(3)
except:
full_code, name_called, name_emitted = match.group(0)[:-1], match.group(1), ""
if(name_emitted==""):
self.add_origin_emits(full_code, name_called, "")
if(name_emitted in constant.LIST_OPERATORS):
full_code = '.'.join(full_code.split(".")[:-1])
self.add_origin_emits(full_code, name_called, "")
else:
self.add_origin_emits(full_code, name_called, name_emitted)
operation = operation.replace(full_code, "")
searching_for_emits = True
stop_pattern_search = True
break
if(stop_pattern_search):
break
case_operation_starts_with_emit = False
#---------------------------
......@@ -384,11 +408,19 @@ class Operation(Executor):
#TODO -> check this
#I've changed this to avoid problems like this : "ch_svdb_dbs.out_occs.toList()"
for match in re.finditer(constant.EMIT_OPERATION, operation+" "):
#full_code, name_called = match.group(1), match.group(2)
#self.add_origin_emits(full_code, name_called, "")
##Remove the emit from the operation code -> so we don't extract it agian
#operation = operation.replace(full_code, "")
#Old
full_code, name_called = match.group(1), match.group(2)
self.add_origin_emits(full_code, name_called, "")
#Remove the emit from the operation code -> so we don't extract it agian
operation = operation.replace(full_code, "")
#Check that it's a the begining of the operation
operation_until_out = operation[:operation.find("out")]
if(operation_until_out==full_code[:full_code.find("out")]):
self.add_origin_emits(full_code, name_called, "")
case_operation_starts_with_emit = True
operation = operation.replace(full_code, "")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment