From 7fdf870c9d7ed3cc1734565b95f09f884848460b Mon Sep 17 00:00:00 2001 From: ilkilic Date: Fri, 22 Nov 2024 17:39:58 +0100 Subject: [PATCH] adjust simulation interval points for IV --- bluepyemodel/emodel_pipeline/plotting.py | 5 ++--- bluepyemodel/emodel_pipeline/plotting_utils.py | 9 ++++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bluepyemodel/emodel_pipeline/plotting.py b/bluepyemodel/emodel_pipeline/plotting.py index b971d14e..314961f9 100644 --- a/bluepyemodel/emodel_pipeline/plotting.py +++ b/bluepyemodel/emodel_pipeline/plotting.py @@ -1236,11 +1236,10 @@ def plot_IV_curves( efel_settings = bluepyefe.tools.DEFAULT_EFEL_SETTINGS.copy() lower_bound = -100 - upper_bound = 300 + upper_bound = 100 # Generate amplitude points - sim_amp_points = list(numpy.linspace(lower_bound, upper_bound, n_bin)) - + sim_amp_points = list(map(int, numpy.linspace(lower_bound, upper_bound, n_bin + 1))) # add missing features (if any) to evaluator updated_evaluator = fill_in_IV_curve_evaluator( evaluator, efel_settings, prot_name, sim_amp_points diff --git a/bluepyemodel/emodel_pipeline/plotting_utils.py b/bluepyemodel/emodel_pipeline/plotting_utils.py index a6078edf..80e6a8ff 100644 --- a/bluepyemodel/emodel_pipeline/plotting_utils.py +++ b/bluepyemodel/emodel_pipeline/plotting_utils.py @@ -337,12 +337,15 @@ def fill_in_IV_curve_evaluator(evaluator, efel_settings, prot_name="iv", new_amp prot_v_deflection.append(prot.name) if new_amps is not None: + prot_name_original = get_original_protocol_name(prot_name, evaluator) for amp in new_amps: - protocol_name_amp = f"{prot_name.split('_')[0]}_{amp}" + protocol_name_amp = f"{prot_name_original.split('_')[0]}_{amp}" if 0 <= amp < 100: - prot_max_v.append(protocol_name_amp) + if protocol_name_amp not in prot_max_v: + prot_max_v.append(protocol_name_amp) elif amp < 0: - prot_v_deflection.append(protocol_name_amp) + if protocol_name_amp not in prot_v_deflection: + prot_v_deflection.append(protocol_name_amp) # maps protocols of interest with all its associated features # also get protocol data we need for feature registration