Skip to content

Commit

Permalink
Merge pull request #184 from optimas-org/bug/fix_new_ax
Browse files Browse the repository at this point in the history
Fix for Ax `v0.3.7`
  • Loading branch information
AngelFP committed Mar 5, 2024
2 parents b7fab35 + c949f23 commit f57175f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion optimas/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.0"
__version__ = "0.4.1"
20 changes: 8 additions & 12 deletions optimas/generators/ax/service/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,14 @@ def _tell(self, trials: List[Trial]) -> None:
trial.status != TrialStatus.FAILED
and not self._enforce_n_init
):
gs = self._ax_client.generation_strategy
if version.parse(ax_version) >= version.parse("0.3.5"):
cs = gs.current_step
ngen, _ = cs.num_trials_to_gen_and_complete()
else:
(
ngen,
_,
) = gs._num_trials_to_gen_and_complete_in_curr_step()
# Reduce only if there are still Sobol trials to generate.
if gs.current_step.model == Models.SOBOL and ngen > 0:
gs.current_step.num_trials -= 1
generation_strategy = self._ax_client.generation_strategy
current_step = generation_strategy.current_step
# Reduce only if there are still Sobol trials left.
if current_step.model == Models.SOBOL:
current_step.num_trials -= 1
if version.parse(ax_version) >= version.parse("0.3.5"):
current_step.transition_criteria[0].threshold -= 1
generation_strategy._maybe_move_to_next_step()
finally:
if trial.completed:
outcome_evals = {}
Expand Down

0 comments on commit f57175f

Please sign in to comment.