diff --git a/chem_spectra/lib/composer/ni.py b/chem_spectra/lib/composer/ni.py index 9b3ebf0f..2e16a1cd 100644 --- a/chem_spectra/lib/composer/ni.py +++ b/chem_spectra/lib/composer/ni.py @@ -155,7 +155,11 @@ def __gen_cyclic_voltammetry_data_peaks(self): y_pecker = self.core.ys[idx] for peak in listMaxMinPeaks: - max_peak, min_peak = peak['max'], peak['min'] + max_peak, min_peak = None, None + if 'max' in peak: + max_peak = peak['max'] + if 'min' in peak: + min_peak = peak['min'] x_max_peak, y_max_peak = self.__get_xy_of_peak(max_peak) x_min_peak, y_min_peak = self.__get_xy_of_peak(min_peak) @@ -302,7 +306,11 @@ def tf_img(self): listMaxMinPeaks = self.core.params['list_max_min_peaks'] for peak in listMaxMinPeaks: - max_peak, min_peak = peak['max'], peak['min'] + max_peak, min_peak = None, None + if 'max' in peak: + max_peak = peak['max'] + if 'min' in peak: + min_peak = peak['min'] x_max_peak, y_max_peak = self.__get_xy_of_peak(max_peak) x_min_peak, y_min_peak = self.__get_xy_of_peak(min_peak) @@ -529,7 +537,11 @@ def tf_csv(self): y_pecker = self.core.ys[idx] for peak in listMaxMinPeaks: - max_peak, min_peak = peak['max'], peak['min'] + max_peak, min_peak = None, None + if 'max' in peak: + max_peak = peak['max'] + if 'min' in peak: + min_peak = peak['min'] x_max_peak, y_max_peak = self.__get_xy_of_peak(max_peak) x_min_peak, y_min_peak = self.__get_xy_of_peak(min_peak)