def sort_peaks_by_edge_distances(feature, peaks): """ Sort peaks by edge-to-edge distances to a feature Arguments: feature (Feature): feature instance peaks (PeakSet): set of peaks that will be sorted into order according to the smallest distance of their edges from the edges of the feature. The sorting is done in place. """ peaks.peaks = sorted(peaks.peaks, key=lambda p: distances.edge_distances(p, feature))
def sort_features_by_edge_distances(peak, features): """ Sort features by edge-to-edge distances to a peak Arguments: peak (Peak): peak instance features (FeatureSet): set of features that will be sorted into order according to the smallest distance of their edges from the edges of the peak. The sorting is done in place. """ features.features = sorted(features.features, key=lambda f: distances.edge_distances(peak, f))
def sort_peaks_by_edge_distances(feature,peaks): """ Sort peaks by edge-to-edge distances to a feature Arguments: feature (Feature): feature instance peaks (PeakSet): set of peaks that will be sorted into order according to the smallest distance of their edges from the edges of the feature. The sorting is done in place. """ peaks.peaks = sorted(peaks.peaks, key = lambda p: distances.edge_distances(p,feature))
def sort_features_by_edge_distances(peak,features): """ Sort features by edge-to-edge distances to a peak Arguments: peak (Peak): peak instance features (FeatureSet): set of features that will be sorted into order according to the smallest distance of their edges from the edges of the peak. The sorting is done in place. """ features.features = sorted(features.features, key = lambda f: distances.edge_distances(peak,f))