From 3b08aa0117c580c5ef7a271fa826ff0947e71ce5 Mon Sep 17 00:00:00 2001
From: aknecht2 <aknecht2@unl.edu>
Date: Mon, 7 Dec 2015 14:54:14 -0600
Subject: [PATCH] Updated validator for missing args.  Updated workflow for
 extract clustering.

---
 ih/validator.py | 2 +-
 ih/workflow.py  | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ih/validator.py b/ih/validator.py
index eda6c17..3f74bc8 100644
--- a/ih/validator.py
+++ b/ih/validator.py
@@ -166,7 +166,7 @@ class Workflow(object):
     def _validateArgumentRequired(self, job, arg, type):
         if "required" in conf.valid[job["executable"]]["arguments"][arg]:
             if arg in job["arguments"]:
-                if not job["arguments"][arg]:
+                if job["arguments"][arg] == "":
                     self.err += "Workflow, Argument Error: Type '%s' job '%s', has empty required argument '%s' \n" % (type, job["name"], arg)
             else:
                 self.err += "Workflow, Argument Error: Type '%s' job '%s', requires argument '%s', no such argument found. \n" % (type, job["name"], arg)
diff --git a/ih/workflow.py b/ih/workflow.py
index e4b8425..3dcd2b0 100644
--- a/ih/workflow.py
+++ b/ih/workflow.py
@@ -638,6 +638,7 @@ class ImageProcessor(Workflow):
             exDep[type] = [[]]
             exInput[type] = [{}]
             jobnum = -1
+            skipFirst = True
             clusternum[type] = 0
             meancluster[type] = 0
             excluster[type] = 0
@@ -650,10 +651,11 @@ class ImageProcessor(Workflow):
                         clusternum[type] += 1
                     if ((clusternum[type] * 100 + jobnum) % int(self.config["cluster"] * 0.3)) == 0:
                         meancluster[type] += 1
-                    if (jobnum % 50) == 0:
+                    if (jobnum % 50) == 0 and not skipFirst:
                         exDep[type].append([])
                         exInput[type].append({})
                         excluster[type] += 1
+                    skipFirst = False
                 extension = "." + infile.split(".")[1]
                 realname = self.files[self.dax][type]["input"][infile]["path"].split("/")[-1].split(".")[0]
                 derivedPath = self.files[self.dax][type]["input"][infile]["derivedPath"]
-- 
GitLab