Skip to content

Commit 8a0d63c

Browse files
Ryan CaliRyan Cali
authored andcommitted
Refactored, cleaned up old comments
1 parent 7895319 commit 8a0d63c

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

pydra/engine/audit.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,8 @@ def audit_task(self, task):
176176
label = task.name
177177
entity_label = type(label)
178178

179-
if hasattr(task.inputs, "executable"):
180-
command = task.cmdline
181-
# assume function task
182-
else:
183-
command = None
184-
# only implementing for file or directories. Check "type" and return "File" or "Directory"
179+
command = task.cmdline if hasattr(task.inputs, "executable") else None
180+
185181
attr_list = attr_fields(task.inputs)
186182
for attrs in attr_list:
187183
if attrs.type in [File, Directory]:
@@ -194,7 +190,8 @@ def audit_task(self, task):
194190
input_path = None
195191
file_hash = None
196192
# at_location = os.path.abspath(input_name)
197-
193+
194+
198195
# if hasattr(task.inputs, "in_file"):
199196
# input_file = task.inputs.in_file
200197
# file_hash = hash_file(input_file)
@@ -232,17 +229,15 @@ def audit_task(self, task):
232229
}
233230
entity_id = f"uid:{gen_uuid()}"
234231
entity_message = {
235-
"@id": entity_id, # add ID here
232+
"@id": entity_id, # add ID here
236233
"Label": print(entity_label),
237-
"AtLocation": input_path, # at_location,
234+
"AtLocation": input_path, #at_location,
238235
"GeneratedBy": "test", # if not part of workflow, this will be none
239236
"@type": "input",
240-
"digest": file_hash, # hash value under helpers.py
237+
"digest": file_hash # hash value under helpers.py
241238
}
242239

243-
# new code to be added here for i/o tracking - WIP
244240

245241
self.audit_message(start_message, AuditFlag.PROV)
246242
self.audit_message(entity_message, AuditFlag.PROV)
247-
# add more fields according to BEP208 doc
248-
# with every field, check in tests
243+

0 commit comments

Comments
 (0)