Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def make_group_and_sort(self, window=False):
discard_rows = np.where(self.trials['stimulus_name'][:] != 'drifting_gratings')[0]
gas = GroupAndSortController(self.trials, window=window, start_discard_rows=discard_rows)
return gas
def make_group_and_sort(self, group_by=None):
return GroupAndSortController(self.units, group_by=group_by)
self.children = [self.stimulus_type_dd] + list(self.children)
def get_trials(self):
return self.units.get_ancestor('NWBFile').epochs
def stimulus_type_dd_callback(self, change):
self.gas.discard_rows = np.where(self.trials['stimulus_name'][:] != self.stimulus_type_dd.value)[0]
def make_group_and_sort(self, window=False):
discard_rows = np.where(self.trials['stimulus_name'][:] != 'drifting_gratings')[0]
gas = GroupAndSortController(self.trials, window=window, start_discard_rows=discard_rows)
return gas
class AllenRasterGroupAndSortController(GroupAndSortController):
def get_groups(self):
self.electrodes = self.dynamic_table.get_ancestor('NWBFile').electrodes
groups = super().get_groups()
groups.update({name: np.unique(self.electrodes[name][:]) for name in self.electrodes.colnames})
return groups
def get_orderable_cols(self):
units_orderable_cols = super().get_orderable_cols()
candidate_cols = [x for x in self.electrodes.colnames
if not (isinstance(self.electrodes[x][0], Iterable) or
isinstance(self.electrodes[x][0], str))]
return units_orderable_cols + [x for x in candidate_cols
if len(robust_unique(self.electrodes[x][:])) > 1]
def make_group_and_sort(self, window=None):
return GroupAndSortController(self.trials, window=window)