-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
good first issueGood for newcomersGood for newcomersrefactoringImproving code qualityImproving code quality
Description
Changing the list of active brackets to a dictionary with the bracket_id as keys would make the code on some occasions more readable. For example this:
# pass information of job submission to Bracket Manager
for bracket in self.active_brackets:
if bracket.bracket_id == job_info['bracket_id']:
# registering is IMPORTANT for Bracket Manager to perform SH
bracket.register_job(job_info['budget'])
break
Could then be rewritten as:
bracket_id = job_info['bracket_id']
self.active_brackets[bracket_id].register_job(job_info['budget'])
This would also have runtime advantages, however these are rather small, given that our active_brackets list is mostly small.
To clean up the dictionary we can then simlpy iterate over the key-value pairs and delete the brackets, that are already done.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersrefactoringImproving code qualityImproving code quality