Skip to content

Commit

Permalink
update for petab select
Browse files Browse the repository at this point in the history
  • Loading branch information
dilpath committed Oct 7, 2024
1 parent 01802e2 commit f221448
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pypesto/select/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
CANDIDATE_SPACE,
MODELS,
PREDECESSOR_MODEL,
UNCALIBRATED_MODELS,
VIRTUAL_INITIAL_MODEL,
CandidateSpace,
Criterion,
Expand Down Expand Up @@ -393,13 +394,13 @@ def __call__(
user_calibrated_models=self.user_calibrated_models,
)

if not iteration[MODELS]:
if not iteration[UNCALIBRATED_MODELS]:
raise StopIteration("No valid models found.")

# TODO parallelize calibration (maybe not sensible if
# `self.select_first_improvement`)
newly_calibrated_models = {}
for model in iteration[MODELS]:
calibrated_models = {}
for model in iteration[UNCALIBRATED_MODELS]:
if (
model.get_criterion(
criterion=self.criterion,
Expand All @@ -419,7 +420,7 @@ def __call__(
else:
self.new_model_problem(model=model)

newly_calibrated_models[model.get_hash()] = model
calibrated_models[model.get_hash()] = model
method_signal = self.handle_calibrated_model(
model=model,
predecessor_model=iteration[PREDECESSOR_MODEL],
Expand All @@ -429,7 +430,7 @@ def __call__(

iteration_results = petab_select.ui.end_iteration(
candidate_space=iteration[CANDIDATE_SPACE],
newly_calibrated_models=newly_calibrated_models,
calibrated_models=calibrated_models,
)

self.calibrated_models.update(iteration_results[MODELS])
Expand Down

0 comments on commit f221448

Please sign in to comment.