Skip to content

Commit

Permalink
Allow for too many seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
altaris committed Jul 21, 2022
1 parent dc5fe13 commit 3dafa64
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions nmoo/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,19 @@ def __init__(
self._max_retry = max_retry
if seeds is None:
self._seeds = [None] * n_runs
elif len(seeds) != n_runs:
raise ValueError("Seed list must be of length n_runs")
elif len(seeds) < n_runs:
raise ValueError(
f"Not enough seeds: provided {len(seeds)} seeds but specified "
f"{n_runs} runs."
)
else:
if len(seeds) > n_runs:
logging.warning(
"Too many seeds: provided %d but only need %d "
"(i.e. n_run)",
len(seeds),
n_runs,
)
self._seeds = seeds

def _compute_global_pareto_population(self, pair: PAPair) -> None:
Expand Down

0 comments on commit 3dafa64

Please sign in to comment.