class_docstr: Find a new point with a series of small steps
class_docstr_tok: ["Find","a","new","point","with","a","series","of","small","steps"]
code: def continue_sampling(self, i):
      if (
          i > 0
          and self.contourpath.samplingpath.fwd_possible
          or i < 0
          and self.contourpath.samplingpath.rwd_possible
      ):
          # we are not done:
          self.goals.insert(0, ("expand-to", i))
          self.goals.append(("sample-at", i))
      else:
          # we are not done, but cannot reach the goal.
          # reverse. Find position from where to reverse
          if i > 0:
              starti, _, _, _ = max(self.points)
              reversei = starti + 1
          else:
              starti, _, _, _ = min(self.points)
              reversei = starti - 1
          if self.log:
              print("reversing at %d..." % starti)
          # how many steps are missing?
          self.nreverses += 1
          deltai = i - starti
          # request one less because one step is spent on
          # the outside try
          # if self.log: print("   %d steps to do at %d -> [from %d, delta=%d] targeting %d." % (
          #    i - starti, starti, reversei, deltai, reversei - deltai))
          # make this many steps in the other direction
          self.goals.append(("sample-at", reversei - deltai))
  
imports: import numpy
  from numpy.linalg import norm
  import matplotlib.pyplot
  from .samplingpath import angle, extrapolate_ahead
label_desc: Use image node_id 1 for calling the ClockedStepSampler obj's underlying member method code with example usage: obj.continue_sampling(i) without return types