Skip to content

Commit b6b93e5

Browse files
committed
fixing output file generation (closes #117)
1 parent 62d8e91 commit b6b93e5

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

wfcommons/wfgen/abstract_recipe.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# Copyright (c) 2020-2024 The WfCommons Team.
4+
# Copyright (c) 2020-2025 The WfCommons Team.
55
#
66
# This program is free software: you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -231,7 +231,6 @@ def _generate_task_files(self, task: Task) -> List[File]:
231231
self._generate_files(task.task_id, task_recipe['input'], "input")
232232
task.input_files = [ifile for ifile in self.tasks_input_files[task.task_id]]
233233

234-
235234
return output_files_list
236235

237236
def _generate_files(self, task_id: str, recipe: Dict[str, Any], input_or_output: str) -> List[File]:
@@ -249,13 +248,17 @@ def _generate_files(self, task_id: str, recipe: Dict[str, Any], input_or_output:
249248
:rtype: List[File]
250249
"""
251250

252-
# Early return due to recursive behavior
253-
if (input_or_output == "output") and (task_id not in self.tasks_output_files):
254-
return []
255-
256251
files_list = []
257252
extension_list: List[str] = []
258253

254+
if (input_or_output == "output") and (task_id not in self.tasks_output_files):
255+
for extension in recipe:
256+
if extension not in extension_list:
257+
file = self._generate_file(extension, recipe, input_or_output)
258+
files_list.append(file)
259+
self.tasks_output_files[task_id] = files_list
260+
return files_list
261+
259262
# Setup of references to relevant maps based in input/output
260263
if input_or_output == "input":
261264
task_files = self.tasks_input_files[task_id]

0 commit comments

Comments
 (0)