Skip to content

Commit

Permalink
Merge cf3e623 into da7c035
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed Nov 21, 2019
2 parents da7c035 + cf3e623 commit 0680bdc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions WDL/CLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def runner(
(k, kwargs[k]) for k in ["copy_input_files", "run_dir", "runtime_cpu_max", "as_me"]
)
if runtime_memory_max:
run_kwargs["runtime_memory_max"] = parse_byte_size(runtime)
run_kwargs["runtime_memory_max"] = parse_byte_size(runtime_memory_max)
if runtime_defaults:
if runtime_defaults.lstrip()[0] == "{":
run_kwargs["runtime_defaults"] = json.loads(runtime_defaults)
Expand Down Expand Up @@ -943,7 +943,7 @@ def cromwell(

# launch Cromwell
jarpath = ensure_cromwell_jar(jarfile)
cromwell_cmd = ["java", "-DLOG_LEVEL=warn", "-DLOG_MODE=pretty"]
cromwell_cmd = ["java", "-DLOG_LEVEL=info", "-DLOG_MODE=pretty"]
cromwell_cmd.extend([config_setting] if config_setting else [])
cromwell_cmd.extend(
[
Expand Down
4 changes: 3 additions & 1 deletion WDL/Expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,9 @@ def _eval(
if isinstance(v, Value.String):
return v
if isinstance(v, Value.Array):
return Value.String(self.options["sep"].join(str(item.value) for item in v.value))
return Value.String(
self.options["sep"].join(item.coerce(Type.String()).value for item in v.value)
)
if v == Value.Boolean(True) and "true" in self.options:
return Value.String(self.options["true"])
if v == Value.Boolean(False) and "false" in self.options:
Expand Down
5 changes: 3 additions & 2 deletions WDL/Value.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,11 @@ def coerce(self, desired_type: Optional[Type.Base] = None) -> Base:
if desired_type and not desired_type.optional and not isinstance(desired_type, Type.Any):
# normally the typechecker should prevent this, but it might have
# had check_quant=False
if isinstance(desired_type, Type.String):
return String("", self.expr)
if self.expr:
raise Error.NullValue(self.expr)
else:
raise Error.InputError("'None' for non-optional input/declaration")
raise Error.InputError("'None' for non-optional input/declaration")
return self

@property
Expand Down
4 changes: 3 additions & 1 deletion tests/test_5stdlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,13 +409,15 @@ def test_concat(self):
echo ~{foo + none + bar}
echo ~{foo + bar + none}
echo ~{foo + bar + i_none}
echo ~{sep='::' [foo,bar,none]}
echo ~{sep='::' [foo,none,bar]}
}
output {
String s = read_string(stdout())
}
}
""")
self.assertEqual(outputs["s"], "foobar\nfoobar42\n\n\n\n\n")
self.assertEqual(outputs["s"], "foobar\nfoobar42\n\n\n\n\n\nfoo::bar::\nfoo::::bar")

def test_read(self):
with open(os.path.join(self._dir, "strings.txt"), "w") as outfile:
Expand Down

0 comments on commit 0680bdc

Please sign in to comment.