Skip to content

Commit

Permalink
Merge branch 'develop' into fix_stau_w_sub
Browse files Browse the repository at this point in the history
  • Loading branch information
dilpath authored Apr 21, 2022
2 parents 4d17565 + b951f39 commit a168150
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions python/amici/petab_objective.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,11 @@ def simulate_petab(
# Log results
sim_cond = petab_problem.get_simulation_conditions_from_measurement_df()
for i, rdata in enumerate(rdatas):
logger.debug(f"Condition: {sim_cond.iloc[i, :].values}, status: "
f"{rdata['status']}, llh: {rdata['llh']}")
sim_cond_id = "N/A" if sim_cond.empty else sim_cond.iloc[i, :].values
logger.debug(
f"Condition: {sim_cond_id}, status: {rdata['status']}, "
f"llh: {rdata['llh']}"
)

return {
LLH: llh,
Expand Down Expand Up @@ -230,7 +233,7 @@ def create_parameterized_edatas(

def create_parameter_mapping(
petab_problem: petab.Problem,
simulation_conditions: Union[pd.DataFrame, Dict],
simulation_conditions: Union[pd.DataFrame, List[Dict]],
scaled_parameters: bool,
amici_model: AmiciModel,
) -> ParameterMapping:
Expand All @@ -254,6 +257,8 @@ def create_parameter_mapping(
if simulation_conditions is None:
simulation_conditions = \
petab_problem.get_simulation_conditions_from_measurement_df()
if isinstance(simulation_conditions, list):
simulation_conditions = pd.DataFrame(data=simulation_conditions)

# Because AMICI globalizes all local parameters during model import,
# we need to do that here as well to prevent parameter mapping errors
Expand Down

0 comments on commit a168150

Please sign in to comment.