try:
    from asv import step_detect
except ImportError:
    pass


class Simple:
    def setup(self):
        self.y = ([1]*20 + [2]*30)*50

    def time_detect_regressions(self):
        step_detect.detect_regressions(self.y)

    def time_solve_potts_approx(self):
        step_detect.solve_potts_approx(self.y, 0.3, p=1)

try:
    from asv import step_detect
except ImportError:
    pass


class Simple:
    def setup(self):
        self.y = ([1]*20 + [2]*30)*50

    if hasattr(step_detect, 'detect_steps'):
        def time_detect_regressions(self):
            steps = step_detect.detect_steps(self.y)
            step_detect.detect_regressions(steps)
    else:
        def time_detect_regressions(self):
            step_detect.detect_regressions(self.y)

    def time_solve_potts_approx(self):
        step_detect.solve_potts_approx(self.y, 0.3, p=1)

Fix benchmarks vs. changes in b1cc0a9aa5107
Fix benchmarks vs. changes in b1cc0a9aa5107

  try:
      from asv import step_detect
  except ImportError:
      pass
  
  
  class Simple:
      def setup(self):
          self.y = ([1]*20 + [2]*30)*50
  
+     if hasattr(step_detect, 'detect_steps'):
-     def time_detect_regressions(self):
+         def time_detect_regressions(self):
+             steps = step_detect.detect_steps(self.y)
+             step_detect.detect_regressions(steps)
+     else:
+         def time_detect_regressions(self):
-         step_detect.detect_regressions(self.y)
+             step_detect.detect_regressions(self.y)
  
      def time_solve_potts_approx(self):
          step_detect.solve_potts_approx(self.y, 0.3, p=1)
  
Fix benchmarks vs. changes in b1cc0a9aa5107
## Code Before:
try:
    from asv import step_detect
except ImportError:
    pass


class Simple:
    def setup(self):
        self.y = ([1]*20 + [2]*30)*50

    def time_detect_regressions(self):
        step_detect.detect_regressions(self.y)

    def time_solve_potts_approx(self):
        step_detect.solve_potts_approx(self.y, 0.3, p=1)

## Instruction:
Fix benchmarks vs. changes in b1cc0a9aa5107
## Code After:
try:
    from asv import step_detect
except ImportError:
    pass


class Simple:
    def setup(self):
        self.y = ([1]*20 + [2]*30)*50

    if hasattr(step_detect, 'detect_steps'):
        def time_detect_regressions(self):
            steps = step_detect.detect_steps(self.y)
            step_detect.detect_regressions(steps)
    else:
        def time_detect_regressions(self):
            step_detect.detect_regressions(self.y)

    def time_solve_potts_approx(self):
        step_detect.solve_potts_approx(self.y, 0.3, p=1)
