docs: def const_potential(f):
      '''
      const_potential(f) yields f if f is a constant potential function; if f is a constant, yields
        a potential function that always yields f; otherwise raises an error.
      '''
      if is_const_potential(f): return f
      elif pimms.is_array(f, 'number'): return PotentialConstant(f)
      else: raise ValueError('Could not convert given value to potential constant: %s' % f)