Skip to content

Commit

Permalink
Merge pull request #7 from Parsl/bug-fixes
Browse files Browse the repository at this point in the history
bug fixes
1. Fix handling CWL input arguments in list form
2. Maintain order listed in CWL for input args if position is not mentioned
3. Update handling optional boolean flags (remove unnecessary space in the command)
  • Loading branch information
NishchayKarle authored Feb 21, 2024
2 parents 300e6aa + 64ecfac commit dc21e06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cwl/cwl_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __process_array_value(self, value: Any, str_quote="") -> str:

def __lt__(self, other) -> bool:
if self.position is None:
return other.position is None
return other.position is not None
return True if other.position is None else self.position < other.position


Expand Down Expand Up @@ -331,7 +331,7 @@ def validate_cwl(cls, cwl_content: Dict[str, any]) -> Dict[str, any]:
"id": Regex(
r"^[a-zA-Z_][a-zA-Z0-9_]*$",
),
"type": input_simple_types,
"type": input_types_schema,
Opt("items"): Or(*input_simple_types),
Opt("default"): Or(
int, float, str, bool, list, error="Invalid default value"
Expand Down Expand Up @@ -499,7 +499,7 @@ def get_command(self, **kwargs) -> str:
else:
raise ArgumentMissing(f"missing required value for argument: {input_arg.arg_id}")

return f"{self.__base_command} {' '.join(input_args)}"
return f"{self.__base_command} {' '.join(filter(None, input_args))}"

def __get_parsl_bash_app_args(self, **kwargs) -> Dict[str, Any]:
"""Args needed to run the command using Parsl
Expand Down

0 comments on commit dc21e06

Please sign in to comment.