Skip to content

Commit

Permalink
Remove useless explicit LoadingOption param
Browse files Browse the repository at this point in the history
This commit removes the useless propagation of the `LoadingOptions`
object when calling the `load_step` method. This fix also improves
performance when parsing large workflows.
  • Loading branch information
GlassOfWhiskey committed Feb 9, 2025
1 parent 039be8f commit 4133226
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cwl_utils/parser/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,15 @@ def load_step(
step: cwl_utils.parser.WorkflowStep,
) -> Process:
if isinstance(step.run, str):
step_run = cwl_utils.parser.load_document_by_uri(
path=step.loadingOptions.fetcher.urljoin(
base_url=cast(str, step.loadingOptions.fileuri),
url=step.run,
return cast(
Process,
cwl_utils.parser.load_document_by_uri(
path=step.loadingOptions.fetcher.urljoin(
base_url=cast(str, step.loadingOptions.fileuri),
url=step.run,
),
),
loadingOptions=step.loadingOptions,
)
return cast(Process, step_run)
else:
return cast(Process, copy.deepcopy(step.run))

Expand Down

0 comments on commit 4133226

Please sign in to comment.