Skip to content

Commit

Permalink
Remove check empty generator
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancescMartiEscofetQC committed Jul 22, 2024
1 parent 46a88cc commit e34b751
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions metalearners/grid_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,7 @@ def fit(
if self.store_results:
self.results_ = _format_results(results=self.raw_results_) # type: ignore
if not self.store_raw_results:
# This just checks that the generator is empty
try:
next(self.raw_results_) # type: ignore
except StopIteration:
self.raw_results_ = None
# The generator will be empty so we replace it with None
self.raw_results_ = None
else:
self.results_ = None

0 comments on commit e34b751

Please sign in to comment.