diff --git a/andes/system.py b/andes/system.py index 5e8809d29..e13f6eb36 100644 --- a/andes/system.py +++ b/andes/system.py @@ -638,18 +638,21 @@ def _init_numba(self, models: OrderedDict): """ Helper function to compile all functions with Numba before init. """ - if self.config.numba: - use_parallel = bool(self.config.numba_parallel) - use_cache = bool(self.config.numba_cache) - nopython = bool(self.config.numba_nopython) + if not self.config.numba: + return - logger.info("Numba compilation initiated, parallel=%s, cache=%s.", - use_parallel, use_cache) - for mdl in models.values(): - mdl.numba_jitify(parallel=use_parallel, - cache=use_cache, - nopython=nopython, - ) + use_parallel = bool(self.config.numba_parallel) + use_cache = bool(self.config.numba_cache) + nopython = bool(self.config.numba_nopython) + + logger.info("Numba compilation initiated, parallel=%s, cache=%s.", + use_parallel, use_cache) + + for mdl in models.values(): + mdl.numba_jitify(parallel=use_parallel, + cache=use_cache, + nopython=nopython, + ) def init(self, models: OrderedDict, routine: str): """