changeset 14:7d78a6afc958 draft default tip

planemo upload for repository https://github.com/goeckslab/gleam commit 1ffd143e57fa952ee9dd84fc141771520aea0791
author goeckslab
date Wed, 26 Nov 2025 17:49:50 +0000
parents f07850192bc2
children
files base_model_trainer.py pycaret_macros.xml pycaret_train.py test-data/expected_best_model_classification.csv test-data/expected_model_classification.h5
diffstat 5 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/base_model_trainer.py	Sat Nov 08 14:20:33 2025 +0000
+++ b/base_model_trainer.py	Wed Nov 26 17:49:50 2025 +0000
@@ -175,6 +175,7 @@
             "feature_interaction",
             "feature_ratio",
             "fix_imbalance",
+            "n_jobs",
         ]:
             val = getattr(self, attr, None)
             if val is not None:
--- a/pycaret_macros.xml	Sat Nov 08 14:20:33 2025 +0000
+++ b/pycaret_macros.xml	Wed Nov 26 17:49:50 2025 +0000
@@ -1,7 +1,7 @@
 <macros>
-    <token name="@TABULAR_LEARNER_VERSION@">0.1.1</token>
+    <token name="@TABULAR_LEARNER_VERSION@">0.1.2</token>
     <token name="@PYCARET_VERSION@">3.3.2</token>
-    <token name="@SUFFIX@">1</token>
+    <token name="@SUFFIX@">2</token>
     <token name="@PYCARET_PREDICT_VERSION@">@PYCARET_VERSION@+@SUFFIX@</token>
     <token name="@PROFILE@">21.05</token>
     <xml name="python_requirements">
--- a/pycaret_train.py	Sat Nov 08 14:20:33 2025 +0000
+++ b/pycaret_train.py	Wed Nov 26 17:49:50 2025 +0000
@@ -1,5 +1,6 @@
 import argparse
 import logging
+import os
 
 from pycaret_classification import ClassificationModelTrainer
 from pycaret_regression import RegressionModelTrainer
@@ -115,6 +116,13 @@
         help="Random seed for PyCaret setup",
     )
     parser.add_argument(
+        "--n-jobs",
+        dest="n_jobs",
+        type=int,
+        default=None,
+        help="Number of parallel jobs; defaults to GALAXY_SLOTS or 1 if unset/invalid.",
+    )
+    parser.add_argument(
         "--probability_threshold",
         type=float,
         default=None,
@@ -129,6 +137,16 @@
 
     args = parser.parse_args()
 
+    # Derive n_jobs from CLI or GALAXY_SLOTS env var
+    if args.n_jobs is not None:
+        n_jobs = args.n_jobs
+    else:
+        slots_str = os.environ.get("GALAXY_SLOTS")
+        try:
+            n_jobs = int(slots_str) if slots_str is not None else 1
+        except ValueError:
+            n_jobs = 1
+
     # Normalize cross-validation flags: --no_cross_validation overrides --cross_validation
     if args.no_cross_validation:
         args.cross_validation = False
@@ -149,6 +167,7 @@
         "feature_ratio": args.feature_ratio,
         "fix_imbalance": args.fix_imbalance,
         "tune_model": args.tune_model,
+        "n_jobs": n_jobs,
         "probability_threshold": args.probability_threshold,
         "best_model_metric": args.best_model_metric,
     }
--- a/test-data/expected_best_model_classification.csv	Sat Nov 08 14:20:33 2025 +0000
+++ b/test-data/expected_best_model_classification.csv	Wed Nov 26 17:49:50 2025 +0000
@@ -9,7 +9,7 @@
 min_child_weight,0.001
 min_split_gain,0.0
 n_estimators,100
-n_jobs,-1
+n_jobs,1
 num_leaves,31
 objective,
 random_state,42
Binary file test-data/expected_model_classification.h5 has changed