From eef4811ab001f843d998ac974713e140b6091c7c Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Tue, 30 Jan 2024 17:37:05 +0100 Subject: [PATCH] Warn if only micro-scale data is used in the similarity computation of adaptivity. (#75) * Warn if only micro-scale data is used in the similarity computation of adaptivity * Formatting * Reword warning * Formatting --- micro_manager/config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/micro_manager/config.py b/micro_manager/config.py index d881c09e..897d95f0 100644 --- a/micro_manager/config.py +++ b/micro_manager/config.py @@ -4,6 +4,7 @@ import json import os +from warnings import warn class Config: @@ -123,6 +124,12 @@ def read_json(self, config_filename): for dname in data["simulation_params"]["adaptivity"]["data"]: self._data_for_adaptivity[dname] = exchange_data[dname] + if self._data_for_adaptivity.keys() == self._write_data_names.keys(): + warn( + "Only micro simulation data is used for similarity computation in adaptivity. This would lead to the" + " same set of active and inactive simulations for the entire simulation time. If this is not intended," + " please include macro simulation data as well.") + self._adaptivity_history_param = data["simulation_params"]["adaptivity"]["history_param"] self._adaptivity_coarsening_constant = data["simulation_params"]["adaptivity"]["coarsening_constant"] self._adaptivity_refining_constant = data["simulation_params"]["adaptivity"]["refining_constant"]