Skip to content

Commit

Permalink
Merge pull request #16 from lbologna/master
Browse files Browse the repository at this point in the history
Merge from lbologna/fork
  • Loading branch information
wvangeit committed Aug 10, 2020
2 parents 163ee6e + bd2f53c commit a931ee8
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions bluepyefe/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,14 @@ def plt_traces(self):
right=0.97, hspace=0.75, wspace=0.2)

for i_plot in range(n_plot):
# reduce figure title length if too long
filename_string = filenames[i_plot]
if len(filename_string) > 50:
filename_fin = filename_string[:18] + ' ... ' + \
filename_string[-18:]
else:
filename_fin = filename_string

axs[i_plot].plot(
ts[i_plot],
voltages[i_plot],
Expand All @@ -403,7 +411,7 @@ def plt_traces(self):
axs[i_plot].set_title(
cellname + " " + expname + " amp:" +
str(amps[i_plot]) +
" file:" + filenames[i_plot])
" file:" + filename_fin)

axs_c[i_plot].plot(
ts[i_plot],
Expand All @@ -413,7 +421,7 @@ def plt_traces(self):
axs_c[i_plot].set_title(
cellname + " " + expname + " amp:" +
str(amps[i_plot]) +
" file:" + filenames[i_plot])
" file:" + filename_fin)

# plt.show()

Expand Down Expand Up @@ -1071,18 +1079,17 @@ def mean_features(self):
self.dataset_mean[expname]['n'][feature][str(target)] = n

if n == 1: # only result from one cell in population
# pick values from this one
# cell instead if more than one sweep
if len(cell_n) > 1:
self.dataset_mean[expname]['mean_features'][
feature][
str(target)] = feat[0]
self.dataset_mean[expname]['std_features'][
feature][str(target)] = cell_std_feat[0]
[bcmean, bcstd, bcld, bcshift] = \
self.dataset_mean[expname][
'cell_bc_features'][feature][str(
target)][0]
# pick values from this cell
val_idx = numpy.where(~numpy.isnan(
numpy.atleast_1d(feat)))[0][0]
self.dataset_mean[expname]['mean_features'][
feature][str(target)] = feat[val_idx]
self.dataset_mean[expname]['std_features'][
feature][str(target)] = cell_std_feat[val_idx]
[bcmean, bcstd, bcld, bcshift] = \
self.dataset_mean[expname][
'cell_bc_features'][feature][str(
target)][val_idx]
else:
self.dataset_mean[expname][
'mean_features'][feature][str(
Expand Down

0 comments on commit a931ee8

Please sign in to comment.