Skip to content

Commit

Permalink
Add information on handling of stopIteration error
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarah Krebs committed Jul 30, 2024
1 parent 7058b45 commit fa96bee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 2.2.1

## Improvements
- Add logger information on handling of stopIteration error (#960)

# 2.2.0

## Features
Expand Down
4 changes: 4 additions & 0 deletions smac/intensifier/intensifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ def __iter__(self) -> Iterator[TrialInfo]:
fails = -1
except StopIteration:
# We stop if we don't find any configuration anymore
logger.warning(
"If you assume your configspace was not yet exhausted, try to "
"increase the number of retries in the config selector."
)
return
else:
logger.debug("Start finding a new challenger in the queue:")
Expand Down
4 changes: 4 additions & 0 deletions smac/intensifier/successive_halving.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,10 @@ def __iter__(self) -> Iterator[TrialInfo]: # noqa: D102
configs.append(config)
except StopIteration:
# We stop if we don't find any configuration anymore
logger.warning(
"If you assume your configspace was not yet exhausted, try to "
"increase the number of retries in the config selector."
)
return

# We keep track of the seed so we always evaluate on the same instances
Expand Down

0 comments on commit fa96bee

Please sign in to comment.