Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select: update for the mkstd version #1541

Draft
wants to merge 1 commit into
base: select_class_models
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pypesto/select/method.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
from dataclasses import dataclass
from enum import Enum
from typing import Any, Callable, Optional
from typing import Any, Callable

import numpy as np
import petab_select
Expand Down Expand Up @@ -422,7 +422,7 @@ def __call__(self) -> tuple[Model, Models]:
def handle_calibrated_model(
self,
model: Model,
predecessor_model: Optional[Model],
predecessor_model: Model,
) -> MethodSignal:
"""Handle the model selection method, given a new calibrated model.

Expand Down Expand Up @@ -451,8 +451,7 @@ def handle_calibrated_model(

# Reject the model if it doesn't improve on the predecessor model.
if (
predecessor_model is not None
and predecessor_model != VIRTUAL_INITIAL_MODEL
predecessor_model.hash != VIRTUAL_INITIAL_MODEL.hash
and not self.model1_gt_model0(
model1=model, model0=predecessor_model
)
Expand Down Expand Up @@ -541,13 +540,14 @@ def new_model_problem(
x_guess = None
if (
self.startpoint_latest_mle
and model.predecessor_model_hash is not None
and model.predecessor_model_hash in self.calibrated_models
):
predecessor_model = self.calibrated_models[
model.predecessor_model_hash
]
if str(model.petab_yaml) != str(predecessor_model.petab_yaml):
if str(model.model_subspace_petab_yaml) != str(
predecessor_model.model_subspace_petab_yaml
):
raise NotImplementedError(
"The PEtab YAML files differ between the model and its "
"predecessor model. This may imply different (fixed union "
Expand Down
Loading