| | |
| | | try: |
| | | # 识别极值点 |
| | | extreme_points = self.identify_local_maxima(df) |
| | | |
| | | # print("识别极值点:", extreme_points) |
| | | # 识别阶段最大值 |
| | | phase_maxima = self.identify_phase_maxima(df) |
| | | # phase_maxima = self.identify_phase_maxima(df) |
| | | # print("识别阶段最大值:", phase_maxima) |
| | | |
| | | # 计算每个极值点的合格率 |
| | | if not extreme_points.empty: |
| | | extreme_points['pass_rate'] = extreme_points.apply(self.calculate_pass_rate, axis=1) |
| | | |
| | | # 计算整体合格率 |
| | | overall_pass_rate = self.calculate_overall_pass_rate(df) |
| | | overall_pass_rate = self.calculate_overall_pass_rate(extreme_points) |
| | | |
| | | return { |
| | | 'extreme_points': extreme_points, |
| | | 'phase_maxima': phase_maxima, |
| | | 'phase_maxima': pd.DataFrame(), |
| | | 'overall_pass_rate': overall_pass_rate |
| | | } |
| | | except Exception as e: |