def _n_sections_per_neurite(self, **kwargs): '''Get an iterable with the number of sections for a given neurite type''' neurite_type = kwargs.get('neurite_type', TreeType.all) return self._iterable_type( [n_sections(n) for n in self.neurites if checkTreeType(neurite_type, n.type)] )
def test_n_sections(): T = SIMPLE_TREE nt.ok_(n_sections(T) == 2) T2 = NEURON_TREE nt.ok_(n_sections(T2) == 3)
def _n_sections(self, **kwargs): '''Get the number of sections of a given type''' neurite_type = kwargs.get('neurite_type', TreeType.all) return sum(n_sections(t) for t in self.neurites if checkTreeType(neurite_type, t.type))
def get_n_sections_per_neurite(self, neurite_type=TreeType.all): '''Get an iterable with the number of sections for a given neurite type''' return self._iterable_type( [n_sections(n) for n in self.neurites if checkTreeType(neurite_type, n.type)] )
def get_n_sections(self, neurite_type=TreeType.all): '''Get the number of sections of a given type''' return sum(n_sections(t) for t in self.neurites if checkTreeType(neurite_type, t.type))
def get_n_sections_per_neurite(self, neurite_type=TreeType.all): '''Get an iterable with the number of sections for a given neurite type''' return self._iterable_type([ n_sections(n) for n in self.neurites if checkTreeType(neurite_type, n.type) ])
def get_n_sections(self, neurite_type=TreeType.all): '''Get the number of sections of a given type''' return sum( n_sections(t) for t in self.neurites if checkTreeType(neurite_type, t.type))