File tree Expand file tree Collapse file tree
ProcessOptimizer/XpyriMentor/suggestors Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import logging
2+ from functools import partial
23from typing import Any , Union , Optional
34
45import numpy as np
@@ -61,6 +62,9 @@ def suggestor_factory(
6162 * suggestors [`dict[str, CreatableSuggestor] | None`]:
6263 A dictionary of available suggestors. The built-in suggestors will be added.
6364 """
65+ # To make sure we supply the correct suggestors when recursing. All other inputs
66+ # could conceivably change, so we only fix suggestors.
67+ forward_suggestor_factory = partial (suggestor_factory , suggestors = suggestors )
6468 if suggestors is None :
6569 suggestors = {}
6670 # For the keys not present in suggestors, add the built-in suggestors
@@ -84,7 +88,7 @@ def suggestor_factory(
8488 raise ValueError (f"Unknown suggestor name: { suggestor_type } " )
8589 return suggestors [suggestor_type ].create_from_definition (
8690 space = space ,
87- suggestor_factory = suggestor_factory ,
91+ suggestor_factory = forward_suggestor_factory ,
8892 definition = definition ,
8993 n_objectives = n_objectives ,
9094 rng = rng ,
You can’t perform that action at this time.
0 commit comments