Skip to content

Commit

Permalink
Use Generator Expressions Instead of List Comprehensions (#38)
Browse files Browse the repository at this point in the history
Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
  • Loading branch information
pixeebot[bot] authored Feb 20, 2024
1 parent 011790e commit 6a4ebc0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sigoptlite/best_assignments.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self, experiment):
self.experiment = experiment
self.full_task_cost = None
if self.experiment.is_multitask:
self.full_task_cost = max([task.cost for task in self.experiment.tasks])
self.full_task_cost = max(task.cost for task in self.experiment.tasks)

def observation_is_valid_and_full_cost(self, observation):
if observation.failed:
Expand Down
2 changes: 1 addition & 1 deletion sigoptlite/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def experiment_progress_dict(self):
observation_count = len(self.observations)
observation_budget_consumed = observation_count
if self.experiment.is_multitask:
observation_budget_consumed = sum([o.task.cost for o in self.observations])
observation_budget_consumed = sum(o.task.cost for o in self.observations)

return dict(
observation_budget_consumed=observation_budget_consumed,
Expand Down

0 comments on commit 6a4ebc0

Please sign in to comment.