Mercurial > repos > bgruening > sklearn_pairwise_metrics
diff keras_deep_learning.py @ 35:8e9ec9713c21 draft
"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5b2ac730ec6d3b762faa9034eddd19ad1b347476"
author | bgruening |
---|---|
date | Mon, 16 Dec 2019 09:58:50 +0000 |
parents | 938008a83b89 |
children | 25c6949b930d |
line wrap: on
line diff
--- a/keras_deep_learning.py Thu Nov 07 05:08:10 2019 -0500 +++ b/keras_deep_learning.py Mon Dec 16 09:58:50 2019 +0000 @@ -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,