Skip to content

Commit

Permalink
Use dict given by initialize() as it is
Browse files Browse the repository at this point in the history
  • Loading branch information
IshaanDesai committed Feb 12, 2024
1 parent 50fc45e commit 7ce1eb6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions micro_manager/micro_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,16 +347,16 @@ def _initialize(self) -> None:
if hasattr(micro_problem, 'initialize') and callable(getattr(micro_problem, 'initialize')):
if self._is_adaptivity_on:
self._micro_sims_init = True
initial_micro_output = self._micro_sims[0].initialize() # Get initial data from first simulation
initial_micro_output = self._micro_sims[0].initialize() # Call initialize() of the first simulation
if initial_micro_output is None: # Check if the detected initialize() method returns any data
if self._rank == 0:
warn("The initialize() call of the Micro simulation has not returned any initial data."
" The initialize call is stopped.")
self._micro_sims_init = False
else:
# Save initial data from first micro simulation as we anyway have it
for name in self._adaptivity_micro_data_names:
self._data_for_adaptivity[name][i] = initial_micro_output[name]
for name in initial_micro_output.keys():
self._data_for_adaptivity[name][0] = initial_micro_output[name]

# Gather initial data from the rest of the micro simulations
for i in range(1, self._local_number_of_sims):
Expand Down

0 comments on commit 7ce1eb6

Please sign in to comment.