Skip to content

Commit 910f114

Browse files
committed
expression refactor: always set the ID for ExpressionTools
1 parent 966abaa commit 910f114

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

cwl_utils/cwl_v1_0_expression_refactor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""CWL Expression refactoring tool for CWL v1.0 ."""
55
import copy
66
import hashlib
7+
import uuid
78
from collections.abc import Mapping, MutableSequence, Sequence
89
from typing import Any, Optional, Union, cast
910

@@ -395,6 +396,7 @@ def generate_etool_from_expr(
395396
find_expressionLib(extra_processes) if extra_processes else None
396397
)
397398
return cwl.ExpressionTool(
399+
id="_:" + str(uuid.uuid4()),
398400
inputs=inputs,
399401
outputs=outputs,
400402
expression=expression,
@@ -1741,6 +1743,7 @@ def generate_etool_from_expr2(
17411743
x for x in reqs if not isinstance(x, cwl.InitialWorkDirRequirement)
17421744
]
17431745
return cwl.ExpressionTool(
1746+
id="_:" + str(uuid.uuid4()),
17441747
inputs=inputs,
17451748
outputs=outputs,
17461749
expression=expression,

cwl_utils/cwl_v1_1_expression_refactor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""CWL Expression refactoring tool for CWL v1.1 ."""
55
import copy
66
import hashlib
7+
import uuid
78
from collections.abc import Mapping, MutableSequence, Sequence
89
from typing import Any, Optional, Union, cast
910

@@ -393,6 +394,7 @@ def generate_etool_from_expr(
393394
find_expressionLib(extra_processes) if extra_processes else None
394395
)
395396
return cwl.ExpressionTool(
397+
id="_:" + str(uuid.uuid4()),
396398
inputs=inputs,
397399
outputs=outputs,
398400
expression=expression,
@@ -1741,6 +1743,7 @@ def generate_etool_from_expr2(
17411743
x for x in reqs if not isinstance(x, cwl.InitialWorkDirRequirement)
17421744
]
17431745
return cwl.ExpressionTool(
1746+
id="_:" + str(uuid.uuid4()),
17441747
inputs=inputs,
17451748
outputs=outputs,
17461749
expression=expression,

cwl_utils/cwl_v1_2_expression_refactor.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""CWL Expression refactoring tool for CWL v1.2 ."""
55
import copy
66
import hashlib
7+
import uuid
78
from collections.abc import Mapping, MutableSequence, Sequence
89
from typing import Any, Optional, Union, cast
910

@@ -393,6 +394,7 @@ def generate_etool_from_expr(
393394
find_expressionLib(extra_processes) if extra_processes else None
394395
)
395396
return cwl.ExpressionTool(
397+
id="_:" + str(uuid.uuid4()),
396398
inputs=inputs,
397399
outputs=outputs,
398400
expression=expression,
@@ -1836,6 +1838,7 @@ def generate_etool_from_expr2(
18361838
x for x in reqs if not isinstance(x, cwl.InitialWorkDirRequirement)
18371839
]
18381840
return cwl.ExpressionTool(
1841+
id="_:" + str(uuid.uuid4()),
18391842
inputs=inputs,
18401843
outputs=outputs,
18411844
expression=expression,

0 commit comments

Comments
 (0)