diff --git a/emodel_generalisation/model/evaluation.py b/emodel_generalisation/model/evaluation.py index e5a7138..7bad1b3 100644 --- a/emodel_generalisation/model/evaluation.py +++ b/emodel_generalisation/model/evaluation.py @@ -240,22 +240,23 @@ def _define_morphology( Returns: bluepyopt.ephys.morphologies.NrnFileMorphology: a morphology object """ - if not morph_modifiers or morph_modifiers is None: - morph_modifiers = [modifiers.replace_axon_with_taper] - logger.debug("No morphology modifiers provided, replace_axon_with_taper will be used.") - else: - if isinstance(morph_modifiers, str): - morph_modifiers = [morph_modifiers] - for i, morph_modifier in enumerate(morph_modifiers): - if isinstance(morph_modifier, list): - modifier_module = importlib.import_module(morph_modifier[0]) - morph_modifiers[i] = getattr(modifier_module, morph_modifier[1]) - elif isinstance(morph_modifier, str): - morph_modifiers[i] = getattr(modifiers, morph_modifier) - elif not callable(morph_modifier): - raise TypeError( - "A morph modifier is not callable nor a string nor a list of two str" - ) + if morph_modifiers != []: + if not morph_modifiers or morph_modifiers is None: + morph_modifiers = [modifiers.replace_axon_with_taper] + logger.debug("No morphology modifiers provided, replace_axon_with_taper will be used.") + else: + if isinstance(morph_modifiers, str): + morph_modifiers = [morph_modifiers] + for i, morph_modifier in enumerate(morph_modifiers): + if isinstance(morph_modifier, list): + modifier_module = importlib.import_module(morph_modifier[0]) + morph_modifiers[i] = getattr(modifier_module, morph_modifier[1]) + elif isinstance(morph_modifier, str): + morph_modifiers[i] = getattr(modifiers, morph_modifier) + elif not callable(morph_modifier): + raise TypeError( + "A morph modifier is not callable nor a string nor a list of two str" + ) return NrnFileMorphology( morphology_path=model_configuration.morphology.path, do_replace_axon=False, diff --git a/examples/mcmc/mcmc_singlecomp/plot_results.py b/examples/mcmc/mcmc_singlecomp/plot_results.py index 260ec30..d28db00 100755 --- a/examples/mcmc/mcmc_singlecomp/plot_results.py +++ b/examples/mcmc/mcmc_singlecomp/plot_results.py @@ -2,7 +2,7 @@ import matplotlib.pyplot as plt -from emodel_generalisation.information import plot_corner +from emodel_generalisation.mcmc import plot_corner from emodel_generalisation.mcmc import load_chains from emodel_generalisation.mcmc import plot_cost from emodel_generalisation.mcmc import plot_cost_convergence diff --git a/examples/mcmc/mcmc_singlecomp/run.py b/examples/mcmc/mcmc_singlecomp/run.py index 63c8406..407b51d 100644 --- a/examples/mcmc/mcmc_singlecomp/run.py +++ b/examples/mcmc/mcmc_singlecomp/run.py @@ -1,6 +1,6 @@ """Run MCMC on a simple single compartment model.""" from emodel_generalisation.mcmc import run_several_chains -from emodel_generalisation.parallel import init_parallel_factory +from bluepyparallel import init_parallel_factory if __name__ == "__main__": parallel_factory = init_parallel_factory("multiprocessing")