Get neurites that are not monotonic

    Args:
        neurite(Neurite): neurite to operate on
        tol(float): the tolerance or the ratio

    Returns:
        list of neurites that do not satisfy monotonicity test
976868
def get_nonmonotonic_neurites(neuron, tol=1e-6):
    '''
    '''
    return [n for n in neuron.neurites if not is_monotonic(n, tol)]
739579
def map_neurons(fun, neurites, neurite_type):
    ''''''
    nrns = _neuronfunc.neuron_population(neurites)
    return [fun(n, neurite_type=neurite_type) for n in nrns]
859869
def has_axon(neuron, treefun=_read_neurite_type):
    '''
    '''
    return CheckResult(NeuriteType.axon in (treefun(n) for n in neuron.neurites))
1124788
def neurite_volume_density(neurites, neurite_type=NeuriteType.all):
    '''
    '''
    def vol_density(neurite):
        '''volume density of a single neurite'''
        return neurite.volume / convex_hull(neurite).volume

    return list(vol_density(n)
                for n in iter_neurites(neurites, filt=is_type(neurite_type)))
583484
def nonDefaults(self):
        
        nonDefaults = {}
        for k, d in self.__class__.defaults.items():
            v = getattr(self, k)
            if v != d and (v == v or d == d):  # tests for NaN too
                nonDefaults[k] = v
        return nonDefaults
721444
def section_term_branch_orders(neurites, neurite_type=NeuriteType.all):
    ''''''
    return map_sections(sectionfunc.branch_order, neurites, neurite_type=neurite_type,
                        iterator_type=Tree.ileaf)
192082
def _isnan(self):
        
        if self._can_hold_na:
            return isna(self)
        else:
            # shouldn't reach to this condition by checking hasnans beforehand
            values = np.empty(len(self), dtype=np.bool_)
            values.fill(False)
            return values
538782
def _check_quantiles(self, val):
        
        if len(val) != 3 or not is_monotonic(val) or not np.all(val < 1):
            raise YellowbrickValueError(
                "quantiles must be a sequence of three "
                "monotonically increasing values less than 1"
            )
        return np.asarray(val)
961415
def trunk_section_lengths(nrn, neurite_type=NeuriteType.all):
    ''''''
    neurite_filter = is_type(neurite_type)
    return [morphmath.section_length(s.root_node.points)
            for s in nrn.neurites if neurite_filter(s)]
318934
def section_term_lengths(neurites, neurite_type=NeuriteType.all):
    ''''''
    return map_sections(_section_length, neurites, neurite_type=neurite_type,
                        iterator_type=Tree.ileaf)
369664
def segment_volumes(neurites, neurite_type=NeuriteType.all):
    ''''''
    def _func(sec):
        '''list of segment volumes of a section'''
        return [morphmath.segment_volume(seg) for seg in zip(sec.points[:-1], sec.points[1:])]

    return map_segments(_func, neurites, neurite_type)
912145
def remote_bifurcation_angles(neurites, neurite_type=NeuriteType.all):
    ''''''
    return map_sections(_bifurcationfunc.remote_bifurcation_angle,
                        neurites,
                        neurite_type=neurite_type,
                        iterator_type=Tree.ibifurcation_point)
102942
def segment_taper_rates(neurites, neurite_type=NeuriteType.all):
    '''
    '''
    def _seg_taper_rates(sec):
        '''vectorized taper rates'''
        pts = sec.points[:, COLS.XYZR]
        diff = np.diff(pts, axis=0)
        distance = np.linalg.norm(diff[:, COLS.XYZ], axis=1)
        return np.divide(2 * np.abs(diff[:, COLS.R]), distance)

    return map_segments(_seg_taper_rates, neurites, neurite_type)
753840
def radius_of_gyration(neurite):
    ''''''
    centre_mass = neurite_centre_of_mass(neurite)
    sum_sqr_distance = 0
    N = 0
    dist_sqr = [distance_sqr(centre_mass, s) for s in nm.iter_segments(neurite)]
    sum_sqr_distance = np.sum(dist_sqr)
    N = len(dist_sqr)
    return np.sqrt(sum_sqr_distance / N)
916806
def principal_direction_extents(neurites, neurite_type=NeuriteType.all, direction=0):
    ''''''
    def _pde(neurite):
        '''Get the PDE of a single neurite'''
        # Get the X, Y,Z coordinates of the points in each section
        points = neurite.points[:, :3]
        return morphmath.principal_direction_extent(points)[direction]

    return map(_pde, iter_neurites(neurites, filt=is_type(neurite_type)))
362543
def _validate_monotonic(self):
        
        if not self._on.is_monotonic:
            formatted = self.on or 'index'
            raise ValueError("{0} must be "
                             "monotonic".format(formatted))
184651
def _dt_to_float_ordinal(dt):
    
    if (isinstance(dt, (np.ndarray, Index, ABCSeries)
                   ) and is_datetime64_ns_dtype(dt)):
        base = dates.epoch2num(dt.asi8 / 1.0E9)
    else:
        base = dates.date2num(dt)
    return base