changeset 2:b8977c98800b draft

"planemo upload for repository https://github.com/rolfverberg/galaxytools commit 0c40fb274acc13ebf7054379bb49ed13acec918e"
author rv43
date Thu, 31 Mar 2022 20:48:17 +0000
parents e4778148df6b
children f9c52762c32c
files tomo.py tomo_setup.py tomo_setup.xml
diffstat 3 files changed, 16 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/tomo.py	Thu Mar 31 18:24:16 2022 +0000
+++ b/tomo.py	Thu Mar 31 20:48:17 2022 +0000
@@ -481,7 +481,6 @@
             return
 
         if self.galaxy_flag:
-            self.num_core = 1 #RV can I set this? mp.cpu_count()
             assert(self.output_folder == '.')
             assert(self.test_mode is False)
             self.save_plots = True
@@ -528,7 +527,7 @@
             self.tomo_stacks = [np.array([]) for _ in range(num_tomo_stacks)]
             self.tomo_recon_stacks = [np.array([]) for _ in range(num_tomo_stacks)]
 
-        logging.info(f'num_core = {self.num_core}')
+        logging.debug(f'num_core = {self.num_core}')
         logging.debug(f'config_file = {config_file}')
         logging.debug(f'config_dict = {config_dict}')
         logging.debug(f'config_out = {self.config_out}')
@@ -1438,7 +1437,7 @@
             # Save tomography stack to file
             if self.galaxy_flag:
                 t0 = time()
-                logging.info(f'Saving preprocessed tomography stack to file ...')
+                logging.info(f'Saving preprocessed tomography stack to {output_name} ...')
                 save_stacks = {f'set_{stack["index"]}':tomo_stack
                         for stack,tomo_stack in zip(stacks,self.tomo_stacks)}
                 np.savez(output_name, **save_stacks)
--- a/tomo_setup.py	Thu Mar 31 18:24:16 2022 +0000
+++ b/tomo_setup.py	Thu Mar 31 20:48:17 2022 +0000
@@ -52,17 +52,17 @@
     logging.basicConfig(format=logging_format, level=level, force=True,
             handlers=[logging.StreamHandler()])
 
-    logging.info(f'config = {args.config}')
-    logging.info(f'theta_range = {args.theta_range.split()}')
-    logging.info(f'dark = {args.dark}')
-    logging.info(f'bright = {args.bright}')
-    logging.info(f'tomo = {args.tomo}')
-    logging.info(f'detectorbounds = {args.detectorbounds}')
-    logging.info(f'output_config = {args.output_config}')
-    logging.info(f'output_data = {args.output_data}')
-    logging.info(f'log = {args.log}')
-    logging.info(f'is log stdout? {args.log is sys.stdout}')
-    logging.info(f'tomoranges = {args.tomo_ranges}')
+    logging.debug(f'config = {args.config}')
+    logging.debug(f'theta_range = {args.theta_range.split()}')
+    logging.debug(f'dark = {args.dark}')
+    logging.debug(f'bright = {args.bright}')
+    logging.debug(f'tomo = {args.tomo}')
+    logging.debug(f'detectorbounds = {args.detectorbounds}')
+    logging.debug(f'output_config = {args.output_config}')
+    logging.debug(f'output_data = {args.output_data}')
+    logging.debug(f'log = {args.log}')
+    logging.debug(f'is log stdout? {args.log is sys.stdout}')
+    logging.debug(f'tomoranges = {args.tomo_ranges}')
 
     # Read input files and collect data files info
     datasets = []
--- a/tomo_setup.xml	Thu Mar 31 18:24:16 2022 +0000
+++ b/tomo_setup.xml	Thu Mar 31 20:48:17 2022 +0000
@@ -1,4 +1,4 @@
-<tool id="tomo_setup" name="Tomo Setup" version="0.1.0" python_template_version="3.9">
+<tool id="tomo_setup" name="Tomo Setup" version="0.1.1" python_template_version="3.9">
     <description>Preprocess tomography images</description>
     <requirements>
         <requirement type="package" version="1.11.0">tomopy</requirement>
@@ -14,7 +14,7 @@
         --bright 'bright_field.png'
         --tomo 'tomo.png'
         --detectorbounds 'detectorbounds.png'
-        --output_data '$output_data'
+        --output_data 'output.npz'
         --output_config 'output_config.yaml'
         -l '$log'
 #for $s in $tomo_sets# ${s.offset} ${s.num} #end for
@@ -47,7 +47,7 @@
         <data name="bright_field" format="png" label="Bright field" from_work_dir="bright_field.png"/>
         <data name="tomo" format="png" label="First tomography image" from_work_dir="tomo.png"/>
         <data name="detectorbounds" format="png" label="Detector bounds" from_work_dir="detectorbounds.png"/>
-        <data name="output_data" format="npz" label="Preprocessed tomography data"/>
+        <data name="output_data" format="npz" label="Preprocessed tomography data" from_work_dir="output_data.npz"/>
         <data name="output_config" format="yaml" label="Output config" from_work_dir="output_config.yaml"/>
         <data name="log" format="txt" label="Log"/>
     </outputs>