diff keras_deep_learning.py @ 5:c3813c64d678 draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5b2ac730ec6d3b762faa9034eddd19ad1b347476"
author bgruening
date Mon, 16 Dec 2019 05:32:49 -0500
parents 0fd7d8e90e2a
children 4471d2b2de79
line wrap: on
line diff
--- a/keras_deep_learning.py	Thu Nov 07 05:38:41 2019 -0500
+++ b/keras_deep_learning.py	Mon Dec 16 05:32:49 2019 -0500
@@ -73,7 +73,7 @@
             }
     """
     constraint_type = config['constraint_type']
-    if constraint_type == 'None':
+    if constraint_type in ('None', ''):
         return None
 
     klass = getattr(keras.constraints, constraint_type)
@@ -92,7 +92,7 @@
     """Access to handle all kinds of parameters
     """
     for key, value in six.iteritems(params):
-        if value == 'None':
+        if value in ('None', ''):
             params[key] = None
             continue
 
@@ -205,6 +205,9 @@
     config : dictionary, galaxy tool parameters loaded by JSON
     """
     generator_type = config.pop('generator_type')
+    if generator_type == 'none':
+        return None
+
     klass = try_get_attr('galaxy_ml.preprocessors', generator_type)
 
     if generator_type == 'GenomicIntervalBatchGenerator':
@@ -240,7 +243,7 @@
     json_string = model.to_json()
 
     with open(outfile, 'w') as f:
-        f.write(json_string)
+        json.dump(json.loads(json_string), f, indent=2)
 
 
 def build_keras_model(inputs, outfile, model_json, infile_weights=None,