Skip to content

Commit b7ae657

Browse files
committed
Revert to telling one point at a time
* File dumps can exactly match requested counts.
1 parent e858bae commit b7ae657

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

optimas/gen_functions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,11 @@ def persistent_generator(H, persis_info, gen_specs, libE_info):
108108
y = calc_in[par.name][i]
109109
ev = Evaluation(parameter=par, value=y)
110110
trial.complete_evaluation(ev)
111+
generator.tell_trials([trial])
111112
trials.append(trial)
112113

113114
# Register trials with unknown SEM
114-
generator.tell_trials(trials)
115+
# generator.tell_trials(trials) # Give as batch
115116

116117
# Set the number of points to generate to that number:
117118
number_of_gen_points = min(n + n_failed_gens, max_evals - n_gens)

tests/test_ax_generators.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,9 @@ def test_ax_single_fidelity_resume():
474474

475475
if not fit_out_of_design:
476476
# Check that no old evaluations were added
477-
assert len(exploration.history) == 11
477+
assert (
478+
len(exploration.history) == 11
479+
), f"Got: {len(exploration.history)}"
478480
assert all(exploration.history.trial_ignored.to_numpy()[:-1])
479481
# Check that the sobol step has not been skipped.
480482
df = ax_client.get_trials_data_frame()
@@ -831,7 +833,7 @@ def test_ax_service_init():
831833
filepath=os.path.join(
832834
exploration.exploration_dir_path,
833835
"model_history",
834-
"ax_client_at_eval_6.json",
836+
"ax_client_at_eval_5.json",
835837
)
836838
)
837839

0 commit comments

Comments
 (0)