Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinsulzer committed Mar 10, 2022
1 parent 87d5ee4 commit fa337e4
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions pybamm/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,19 +515,16 @@ def build_for_experiment(self, check_model=True):
unbuilt_model,
parameter_values,
) in self.op_conds_to_model_and_param.items():
if unbuilt_model in processed_models:
built_model = processed_models[unbuilt_model]
else:
# It's ok to modify the models in-place as they are not accessible
# from outside the simulation
model_with_set_params = parameter_values.process_model(
unbuilt_model, inplace=True
)
built_model = self._disc.process_model(
model_with_set_params, inplace=True, check_model=check_model
)
processed_models[unbuilt_model] = built_model
# It's ok to modify the models in-place as they are not accessible
# from outside the simulation
model_with_set_params = parameter_values.process_model(
unbuilt_model, inplace=True
)
built_model = self._disc.process_model(
model_with_set_params, inplace=True, check_model=check_model
)

processed_models[unbuilt_model] = built_model
self.op_conds_to_built_models[op_cond] = built_model

def solve(
Expand Down

0 comments on commit fa337e4

Please sign in to comment.