Skip to content

Commit 06192bb

Browse files
author
Caspar van Leeuwen
committed
Add more clear comments
1 parent c3a67d5 commit 06192bb

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

eessi_software_reproduce_stack.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ def write_software_info(local_software_info, easystack_file, build_duration):
171171
build_duration_current_easystack = 0
172172
write_preamble = True
173173
local_software_info = {}
174+
# We loop over software_info items and add those to local_software_info until we either hit a new EB version that
175+
# needs to be used, or exceed the maximum build duration. Then, we write the local_software_info to an easystack
176+
# file, reset the local_software_info and the build duration counters, and continue with the next iteration
174177
for software_name, info in software_info.items():
175178
if (
176179
len(local_software_info) > 0 and # Skip first iteration, there's nothing to flush to disk yet
@@ -179,11 +182,6 @@ def write_software_info(local_software_info, easystack_file, build_duration):
179182
(build_duration_current_easystack + info["build_duration"]) > max_build_time
180183
)
181184
):
182-
# Write previous local_software_info to an easystack
183-
# Get eb version from any local_software_info entry
184-
# next(iter(...)) returns the 'first' key-value pair in the dict as tuple, [1] gets the first element
185-
# ebver = next(iter(local_software_info.items()))[1]["easybuild_version"]
186-
# AFTER ALL I DONT THINK I NEED THE ABOVE, I CAN USE PREVIOUS_EB_VER
187185
easystack_file = f'easystack-{sequence_number}-eb-{previous_eb_ver}.yml'
188186
write_software_info(local_software_info, easystack_file, build_duration_current_easystack)
189187
build_duration_current_easystack = 0
@@ -196,7 +194,7 @@ def write_software_info(local_software_info, easystack_file, build_duration):
196194
total_build_duration = total_build_duration + info["build_duration"]
197195
previous_eb_ver = info["easybuild_version"]
198196

199-
# Flush the last local_software_info to disk
197+
# Flush the local_software_info to disk on last time
200198
easystack_file = f'easystack-{sequence_number}-eb-{previous_eb_ver}.yml'
201199
write_software_info(local_software_info, easystack_file, build_duration_current_easystack)
202200

0 commit comments

Comments
 (0)