code: def round_parameterlimits(plo, phi, paramlimitguess=None):
      """Guess the current parameter range.
  
      Parameters
      -----------
      plo: array of floats
          for each parameter, current minimum value
      phi: array of floats
          for each parameter, current maximum value
      paramlimitguess: array of float tuples
          for each parameter, guess of parameter range if available
  
      Returns
      -------
      plo_rounded: array of floats
          for each parameter, rounded minimum value
      phi_rounded: array of floats
          for each parameter, rounded maximum value
      formats: array of float tuples
          for each parameter, string format for representing it.
  
      """
      with np.errstate(divide="ignore"):
          expos = log10(np.abs([plo, phi]))
      expolo = np.floor(np.min(expos, axis=0))
      expohi = np.ceil(np.max(expos, axis=0))
      is_negative = plo < 0
      plo_rounded = np.where(is_negative, -(10**expohi), 0)
      phi_rounded = np.where(is_negative, 10**expohi, 10**expohi)
  
      if paramlimitguess is not None:
          for i, (plo_guess, phi_guess) in enumerate(paramlimitguess):
              # if plo_guess is higher than what we thought, we can increase to match
              if plo_guess <= plo[i] and plo_guess >= plo_rounded[i]:
                  plo_rounded[i] = plo_guess
              if phi_guess >= phi[i] and phi_guess <= phi_rounded[i]:
                  phi_rounded[i] = phi_guess
  
      formats = []
      for i in range(len(plo)):
          fmt = "%+.1e"
          if -1 <= expolo[i] <= 2 and -1 <= expohi[i] <= 2:
              fmt = "%+.1f"
          if -4 <= expolo[i] <= 0 and -4 <= expohi[i] <= 0:
              fmt = "%%+.%df" % (max(0, -min(expolo[i], expohi[i])))
          if phi[i] == plo[i]:
              fmt = "%+.1f"
          elif fmt % plo[i] == fmt % phi[i]:
              fmt = "%%+.%df" % (
                  max(0, -int(np.floor(log10(phi[i] - plo[i]))))
              )
          formats.append(fmt)
  
      return plo_rounded, phi_rounded, formats
  
file_path: ultranest/ultranest/viz.py
imports: from __future__ import print_function, division
  import sys
  import shutil
  from numpy import log10
  import numpy
  import string
  from xml.sax.saxutils import escape
label_desc: Use image node_id 1 for calling a global function with example usage: round_parameterlimits(plo, phi, paramlimitguess) and returns: plo_rounded,  phi_rounded,  formats