From de8b7f68bcd90d7273e5a3746a5d21f6145a6a4c Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Wed, 7 Feb 2024 16:01:07 +0100 Subject: [PATCH] Check is_sim_active --- micro_manager/adaptivity/global_adaptivity.py | 2 ++ micro_manager/micro_manager.py | 15 ++++----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/micro_manager/adaptivity/global_adaptivity.py b/micro_manager/adaptivity/global_adaptivity.py index 5ffaa949..e125147e 100644 --- a/micro_manager/adaptivity/global_adaptivity.py +++ b/micro_manager/adaptivity/global_adaptivity.py @@ -104,6 +104,8 @@ def compute_adaptivity( is_sim_active = self._update_active_sims(similarity_dists, is_sim_active_nm1) + self._logger.info("is_sim_active: {}".format(is_sim_active)) + is_sim_active, sim_is_associated_to = self._update_inactive_sims( similarity_dists, is_sim_active_nm1, sim_is_associated_to_nm1, micro_sims) diff --git a/micro_manager/micro_manager.py b/micro_manager/micro_manager.py index ba58afbd..4b6826ed 100644 --- a/micro_manager/micro_manager.py +++ b/micro_manager/micro_manager.py @@ -135,6 +135,10 @@ def solve(self) -> None: """ t, n = 0, 0 t_checkpoint, n_checkpoint = 0, 0 + similarity_dists_cp = None + is_sim_active_cp = None + sim_is_associated_to_cp = None + sim_states_cp = [None] * self._local_number_of_sims if self._is_adaptivity_on: similarity_dists = np.zeros( @@ -153,17 +157,6 @@ def solve(self) -> None: similarity_dists, is_sim_active, sim_is_associated_to = self._adaptivity_controller.compute_adaptivity( self._dt, self._micro_sims, similarity_dists, is_sim_active, sim_is_associated_to, self._data_for_adaptivity) - if self._adaptivity_type == "local": - active_sim_ids = np.where(is_sim_active)[0] - elif self._adaptivity_type == "global": - active_sim_ids = np.where( - is_sim_active[self._global_ids_of_local_sims[0]:self._global_ids_of_local_sims[-1] + 1])[0] - - similarity_dists_cp = None - is_sim_active_cp = None - sim_is_associated_to_cp = None - sim_states_cp = [None] * self._local_number_of_sims - while self._participant.is_coupling_ongoing(): # Write a checkpoint if self._participant.requires_writing_checkpoint():