Skip to content

Commit

Permalink
Merge pull request #160 from BlueBrain/bad-bAP-case
Browse files Browse the repository at this point in the history
handling mismatch in bAP plot
  • Loading branch information
AurelienJaquier authored Jul 18, 2024
2 parents 462aec3 + db351e9 commit 45acd9a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions bluepyemodel/emodel_pipeline/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,14 @@ def plot_bAP(
if 0 in basal_distances:
basal_x_fit, basal_y_fit = bAP_fit(basal_feature, basal_distances, basal_values)

if len(apical_distances) != len(apical_values) or len(basal_distances) != len(basal_values):
logger.warning(
"Cannot plot figure for bAP because of mismatch between "
"distances list and feature values list. This can happen when "
"the emodel is bad and cannot even compute curent threshold."
)
return fig, ax

ax.scatter(
apical_distances,
apical_values,
Expand Down Expand Up @@ -1029,6 +1037,16 @@ def plot_EPSP(
if 0 in basal_distances:
basal_x_fit, basal_y_fit = EPSP_fit(basal_basalrec_feat, basal_distances, basal_attenuation)

if len(apical_distances) != len(apical_attenuation) or len(basal_distances) != len(
basal_attenuation
):
logger.warning(
"Cannot plot figure for bAP because of mismatch between "
"distances list and feature values list. This can happen when "
"the emodel is bad and cannot even compute curent threshold."
)
return fig, ax

ax.scatter(
apical_distances,
apical_attenuation,
Expand Down

0 comments on commit 45acd9a

Please sign in to comment.