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") diff --git a/tests/data/config/recipes.json b/tests/data/config/recipes.json index a2002a0..b45601a 100644 --- a/tests/data/config/recipes.json +++ b/tests/data/config/recipes.json @@ -4,7 +4,7 @@ "morphology": "simple.asc", "params": "config/parameters.json", "features": "config/features.json", - "morph_modifiers": [], + "morph_modifiers": "", "pipeline_settings": { "efel_settings":{ "strict_stiminterval": true, diff --git a/tests/test_access_point.py b/tests/test_access_point.py index b98da99..3f0105e 100644 --- a/tests/test_access_point.py +++ b/tests/test_access_point.py @@ -44,7 +44,7 @@ def test_get_recipes(access_point): "morphology": "simple.asc", "params": "config/parameters.json", "features": "config/features.json", - "morph_modifiers": [], + "morph_modifiers": "", "pipeline_settings": { "efel_settings": { "strict_stiminterval": True, @@ -65,7 +65,7 @@ def test_get_settings(access_point): "name_rmp_protocol": "IV_0", "name_Rin_protocol": "IV_-20", "test": 0, - "morph_modifiers": [], + "morph_modifiers": "", }