class_docstr: Widget for ipython and jupyter notebooks.
  
  Shows where the live points are currently in parameter space.
docstr: Update widget to show current live points and integration progress to stdout.
  
  Parameters
  -----------
  points: dict with keys u, p, logl
      live points (u: cube coordinates, p: transformed coordinates,
      logl: loglikelihood values)
  info: dict
      integration information. Keys are:
  
      - paramlims (optional): parameter ranges
      - logvol: expected volume at this iteration
  
  region: MLFriends
      Current region.
  transformLayer: ScaleLayer or AffineLayer
      Current transformLayer (for clustering information).
  region_fresh: bool
      Whether the region was just updated.
docstr_tok: ["Update","widget","to","show","current","live","points","and","integration","progress","to","stdout",".","Parameters","--","--","--","--","--","-","points",":","dict","with","keys","u",",","p",",","logl","live","points","(","u",":","cube","coordinates",",","p",":","transformed","coordinates",",","logl",":","loglikelihood","values",")","info",":","dict","integration","information",".","Keys","are",":","-","paramlims","(","optional",")",":","parameter","ranges","-","logvol",":","expected","volume","at","this","iteration","region",":","MLFriends","Current","region",".","transformLayer",":","ScaleLayer","or","AffineLayer","Current","transformLayer","(","for","clustering","information",")",".","region_fresh",":","bool","Whether","the","region","was","just","updated","."]
code: def __call__(
      self, points, info, region, transformLayer, region_fresh=False
  ):
      """Update widget to show current live points and integration progress to stdout.
  
      Parameters
      -----------
      points: dict with keys u, p, logl
          live points (u: cube coordinates, p: transformed coordinates,
          logl: loglikelihood values)
      info: dict
          integration information. Keys are:
  
          - paramlims (optional): parameter ranges
          - logvol: expected volume at this iteration
  
      region: MLFriends
          Current region.
      transformLayer: ScaleLayer or AffineLayer
          Current transformLayer (for clustering information).
      region_fresh: bool
          Whether the region was just updated.
  
      """
      # t = time.time()
      # if self.lastupdate is not None and self.lastupdate < t - 5:
      #    return
      # self.lastupdate = t
      # u, p, logl = points['u'], points['p'], points['logl']
      p = points["p"]
      paramnames = info["paramnames"]
      # print()
      # print('lnZ = %.1f, remainder = %.1f, lnLike = %.1f | Efficiency: %d/%d = %.4f%%\r' % (
      #       logz, logz_remain, np.max(logl), ncall, it, it * 100 / ncall))
  
      plo = p.min(axis=0)
      phi = p.max(axis=0)
      plo_rounded, phi_rounded, paramformats = round_parameterlimits(
          plo, phi, paramlimitguess=info.get("paramlims")
      )
  
      width = 50
  
      if self.grid is None:
          self.initialize(paramnames, width)
  
      with np.errstate(invalid="ignore"):
          indices = (
              (p - plo_rounded)
              * width
              / (phi_rounded - plo_rounded).reshape((1, -1))
          ).astype(int)
      indices[indices >= width] = width - 1
      indices[indices < 0] = 0
      ndim = len(plo)
  
      clusterids = transformLayer.clusterids % len(clusteridstrings)
      nmodes = transformLayer.nclusters
      labeltext = (
          ("Mono-modal" if nmodes == 1 else "Have %d modes" % nmodes)
          + (" | Volume: ~exp(%.2f) " % region.estimate_volume())
          + ("*" if region_fresh else " ")
          + " | Expected Volume: exp(%.2f)" % info["logvol"]
          + (
              ""
              if "order_test_correlation" not in info
              else (
                  " | Quality: correlation length: %d (%s)"
                  % (
                      info["order_test_correlation"],
                      "+" if info["order_test_direction"] >= 0 else "-",
                  )
              )
              if np.isfinite(info["order_test_correlation"])
              else " | Quality: ok"
          )
      )
  
      if ndim == 1:
          pass
      elif ndim == 2 and spearman is not None:
          rho, pval = spearman(p)
          if pval < 0.01 and abs(rho) > 0.75:
              labeltext += "<br/>   %s between %s and %s: rho=%.2f" % (
                  "positive degeneracy"
                  if rho > 0
                  else "negative degeneracy",
                  paramnames[0],
                  paramnames[1],
                  rho,
              )
      elif spearman is not None:
          rho, pval = spearman(p)
          for i, param in enumerate(paramnames):
              for j, param2 in enumerate(paramnames[:i]):
                  if pval[i, j] < 0.01 and abs(rho[i, j]) > 0.99:
                      labeltext += (
                          "<br/>   perfect %s between %s and %s"
                          % (
                              "positive relation"
                              if rho[i, j] > 0
                              else "negative relation",
                              param2,
                              param,
                          )
                      )
                  elif pval[i, j] < 0.01 and abs(rho[i, j]) > 0.75:
                      labeltext += (
                          "<br/>   %s between %s and %s: rho=%.2f"
                          % (
                              "positive degeneracy"
                              if rho[i, j] > 0
                              else "negative degeneracy",
                              param2,
                              param,
                              rho[i, j],
                          )
                      )
  
      for i, (param, fmt) in enumerate(zip(paramnames, paramformats)):
          if nmodes == 1:
              line = [" " for _ in range(width)]
              for j in np.unique(indices[:, i]):
                  line[j] = "*"
              linestr = "".join(line)
          else:
              line = [" " for _ in range(width)]
              for clusterid, j in zip(clusterids, indices[:, i]):
                  if clusterid > 0 and line[j] in (" ", "0"):
                      # set it to correct cluster id
                      line[j] = clusteridstrings[clusterid]
                  elif clusterid == 0 and line[j] == " ":
                      # empty, so set it although we don't know the cluster id
                      line[j] = "0"
                  # else:
                  #     line[j] = '*'
              linestr = "".join(line)
  
          oldlinestr = self.laststatus[i]
          for j, (c, d) in enumerate(zip(linestr, oldlinestr)):
              if c != d:
                  if c == " ":
                      self.grid[
                          i, j + 2
                      ].value = "<div style='background-color:white;'>&nbsp;</div>"
                  else:
                      self.grid[i, j + 2].value = (
                          "<div style='background-color:#6E6BF4; font-family:monospace'>%s</div>"
                          % c.replace("*", "&nbsp;")
                      )
  
          self.laststatus[i] = linestr
          # self.grid[i,0].value = param
          self.grid[i, 1].value = fmt % plo_rounded[i]
          self.grid[i, -1].value = fmt % phi_rounded[i]
  
      self.label.value = labeltext
  
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 3 for calling the LivePointsWidget obj's underlying member method code with example usage: obj.__call__(points, info, region, transformLayer, region_fresh) without return types