diff simple_model_fit.py @ 30:4b359039f09f draft

"planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit ea12f973df4b97a2691d9e4ce6bf6fae59d57717"
author bgruening
date Sat, 01 May 2021 01:03:56 +0000
parents de360b57a5ab
children 1fe00785190d
line wrap: on
line diff
--- a/simple_model_fit.py	Tue Apr 13 22:28:10 2021 +0000
+++ b/simple_model_fit.py	Sat May 01 01:03:56 2021 +0000
@@ -7,7 +7,6 @@
 from scipy.io import mmread
 from sklearn.pipeline import Pipeline
 
-
 N_JOBS = int(__import__("os").environ.get("GALAXY_SLOTS", 1))
 
 
@@ -36,7 +35,7 @@
         if name == "memory" or name.endswith("__memory") or name.endswith("_path"):
             new_p = {name: None}
             estimator.set_params(**new_p)
-        elif n_jobs is not None and (name == 'n_jobs' or name.endswith('__n_jobs')):
+        elif n_jobs is not None and (name == "n_jobs" or name.endswith("__n_jobs")):
             new_p = {name: n_jobs}
             estimator.set_params(**new_p)
         elif name.endswith("callbacks"):
@@ -68,7 +67,9 @@
     # tabular input
     if input_type == "tabular":
         header = "infer" if params["input_options"]["header1"] else None
-        column_option = params["input_options"]["column_selector_options_1"]["selected_column_selector_option"]
+        column_option = params["input_options"]["column_selector_options_1"][
+            "selected_column_selector_option"
+        ]
         if column_option in [
             "by_index_number",
             "all_but_by_index_number",
@@ -90,7 +91,9 @@
 
     # Get target y
     header = "infer" if params["input_options"]["header2"] else None
-    column_option = params["input_options"]["column_selector_options_2"]["selected_column_selector_option2"]
+    column_option = params["input_options"]["column_selector_options_2"][
+        "selected_column_selector_option2"
+    ]
     if column_option in [
         "by_index_number",
         "all_but_by_index_number",
@@ -108,12 +111,9 @@
         infile2 = pd.read_csv(infile2, sep="\t", header=header, parse_dates=True)
         loaded_df[df_key] = infile2
 
-    y = read_columns(infile2,
-                     c=c,
-                     c_option=column_option,
-                     sep='\t',
-                     header=header,
-                     parse_dates=True)
+    y = read_columns(
+        infile2, c=c, c_option=column_option, sep="\t", header=header, parse_dates=True
+    )
     if len(y.shape) == 2 and y.shape[1] == 1:
         y = y.ravel()