Skip to content

Commit

Permalink
Do not run query in solution init.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandervsokol committed Nov 18, 2024
1 parent 4fa5fba commit d3c133e
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions cl/hackathon/hackathon_solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,36 +118,17 @@ def init(self) -> Self:
if not is_resulting_solution:
if self.trial_count is None:
self.trial_count = str(10)
else:
self.inputs = self.get_inputs()
self.outputs = self.get_outputs()

output_count = len(self.outputs) if self.outputs else None
if output_count:
completed_output_count = len([x for x in self.outputs if x.status == "Completed"])
if output_count == completed_output_count:
self.status = "Completed"
# try:
# if is_resulting_solution:
# self.retrievals = self.view_retrievals()
# except Exception as e:
# # Continue even if retrievals are not available
# pass

else:
pct_done = int(round(completed_output_count / output_count * 100, 0))
self.status = f"{pct_done}% Done"

# Return self to enable method chaining
return self

def view_inputs(self) -> List[HackathonInput]:
"""Return the list of inputs specified by the trade list."""
return self.get_inputs()
return self.inputs

def view_outputs(self) -> List[HackathonOutput]:
"""Return the list of outputs (each with its score)."""
return self.get_outputs()
return self.outputs

def view_statistics(self) -> List[HackathonScoringStatistics]:
"""Return the list of inputs specified by the trade list."""
Expand Down

0 comments on commit d3c133e

Please sign in to comment.