def _set_result(self, result): tag = os.path.join(self.tmpdir.name, '.complete') open(tag, 'w').close() output = [nrd_output.Output(result[i]) for i in range(len(result))] output.sort(key=operator.attrgetter('injection')) self.output = np.array(output, dtype=object)
def __init__(self, filename, features=[], stim_time=None): # model.h5 is used if only a directory is specified, but a .h5 file with different name can be specified print('NeurordResults', filename) if os.path.isdir(filename): dirname = filename filenames = [dirname + '/model.h5'] else: #case with only a single filename specified dirname = os.path.dirname(filename) if filename.endswith('.h5'): filenames = [filename] else: #case with a set of filenames specified exp_set = os.path.basename(filename) filenames = glob.glob(filename + '*.h5') print('NeurordResult, exp_set', exp_set, ', files', filenames) super().__init__( dirname, features ) #define some features here? Such as norm, baseline, peak, peaktime? output = [nrd_output.Output(fname, stim_time) for fname in filenames] output.sort(key=operator.attrgetter('injection')) self.output = np.array(output)