code: def get_extrema(self, normalize_rxn_coordinate=True):
          
          x = np.arange(0, np.max(self.r), 0.01)
          y = self.spline(x) * 1000
  
          scale = 1 if not normalize_rxn_coordinate else 1 / self.r[-1]
          min_extrema = []
          max_extrema = []
          for i in range(1, len(x) - 1):
              if y[i] < y[i-1] and y[i] < y[i+1]:
                  min_extrema.append((x[i] * scale, y[i]))
              elif y[i] > y[i-1] and y[i] > y[i+1]:
                  max_extrema.append((x[i] * scale, y[i]))
          return min_extrema, max_extrema
docs: Returns the positions of the extrema along the MEP. Both local
          minimums and maximums are returned.
  
          Args:
              normalize_rxn_coordinate (bool): Whether to normalize the
                  reaction coordinate to between 0 and 1. Defaults to True.
  
          Returns:
              (min_extrema, max_extrema), where the extrema are given as
              [(x1, y1), (x2, y2), ...].