changeset 2:3bb6c1e9252e draft default tip

planemo upload for repository https://github.com/sybila/galaxytools/tree/master/tools/ebcsgen commit 4719a69f514aed27d90c7017f052463b0b43cbb0
author sybila
date Sat, 15 Oct 2022 09:23:30 +0000
parents f280183d1289
children
files ebcsgen_pctl_parameter_synthesis.py ebcsgen_pctl_parameter_synthesis.xml macros.xml
diffstat 3 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ebcsgen_pctl_parameter_synthesis.py	Fri Oct 14 16:25:57 2022 +0000
+++ b/ebcsgen_pctl_parameter_synthesis.py	Sat Oct 15 09:23:30 2022 +0000
@@ -7,6 +7,14 @@
 from eBCSgen.Parsing.ParsePCTLformula import PCTLparser
 
 
+class FakeFile:
+    def __init__(self, content):
+        self.content = content.decode("utf-8")
+
+    def read(self):
+        return self.content
+
+
 args_parser = argparse.ArgumentParser(description='Parameter synthesis')
 
 args_parser._action_groups.pop()
@@ -43,8 +51,12 @@
 formula = PCTLparser().parse(args.formula)
 if formula.success:
     result = PCTL.parameter_synthesis(ts, formula, region)
-    f = open(args.output, "w")
-    f.write(result.decode("utf-8"))
-    f.close()
+    if "?" not in args.formula:
+        result = FakeFile(result)
+        df = PCTL.process_output(result)
+        df.to_csv(args.output, index=False)
+    else:
+        with open(args.output, "w") as f:
+            f.write(result.decode("utf-8"))
 else:
     raise FormulaParsingError(formula.data, args.formula)
--- a/ebcsgen_pctl_parameter_synthesis.xml	Fri Oct 14 16:25:57 2022 +0000
+++ b/ebcsgen_pctl_parameter_synthesis.xml	Sat Oct 15 09:23:30 2022 +0000
@@ -40,7 +40,7 @@
     </inputs>
 
     <outputs>
-        <data format="txt" name="output_regions">
+        <data format="csv" name="output_regions">
             <filter>"?" not in formula</filter>
         </data>
         <data format="storm.sample" name="output_sample">
@@ -62,11 +62,7 @@
                 <param name="from" value="0.05"/>
                 <param name="to" value="1.0"/>
             </repeat>
-            <output name="output_regions" ftype="txt">
-                <assert_contents>
-                    <has_text text="Region results:"/>
-                </assert_contents>
-             </output>
+            <output name="output_regions" value="pctl_syntheisis_regions.csv" ftype="csv"/>
         </test>
         <test>
             <param name="transition_file" value="parametrised.bcsl.ts" ftype="bcsl.ts"/>
--- a/macros.xml	Fri Oct 14 16:25:57 2022 +0000
+++ b/macros.xml	Sat Oct 15 09:23:30 2022 +0000
@@ -1,5 +1,5 @@
 <macros>
-    <token name="@TOOL_VERSION@">2.0.4</token>
+    <token name="@TOOL_VERSION@">2.1.0</token>
 
     <xml name="creator">
         <creator>