def add_match(self, name, abbreviation, peaks): matches = score_minerals(self.marker_peaks, [(name, abbreviation, peaks)]) if len(matches): name, abbreviation, peaks, matches, score = matches[0] else: matches, score = [], 0.0 self.matches.append([name, abbreviation, peaks, matches, score]) sorted(self._matches, key=lambda match: match[-1], reverse=True) self.matches_changed.emit()
def add_match(self, name, abbreviation, peaks): matches = score_minerals(self.marker_peaks, [(name, abbreviation, peaks)]) if len(matches): name, abbreviation, peaks, matches, score = matches[0] else: matches, score = [], 0. self.matches.append([name, abbreviation, peaks, matches, score]) sorted(self._matches, key=lambda match: match[-1], reverse=True) self.matches_changed.emit()
def auto_match(self): self._matches = score_minerals(self.marker_peaks, self.minerals) self.matches_changed.emit()