class_docstr: Define basic tools for triangular mesh analysis and improvement.
  
  A TriAnalyzer encapsulates a `.Triangulation` object and provides basic
  tools for mesh analysis and mesh improvement.
  
  Attributes
  ----------
  scale_factors
  
  Parameters
  ----------
  triangulation : `~matplotlib.tri.Triangulation`
      The encapsulated triangulation to analyze.
docstr: Parameters
  ----------
  valid : 1D bool array
      Validity mask.
  
  Returns
  -------
  int array
      Array so that (`valid_array` being a compressed array
      based on a `masked_array` with mask ~*valid*):
  
      - For all i with valid[i] = True:
        valid_array[renum[i]] = masked_array[i]
      - For all i with valid[i] = False:
        renum[i] = -1 (invalid value)
code: def _total_to_compress_renum(valid):
      """
      Parameters
      ----------
      valid : 1D bool array
          Validity mask.
  
      Returns
      -------
      int array
          Array so that (`valid_array` being a compressed array
          based on a `masked_array` with mask ~*valid*):
  
          - For all i with valid[i] = True:
            valid_array[renum[i]] = masked_array[i]
          - For all i with valid[i] = False:
            renum[i] = -1 (invalid value)
      """
      renum = np.full(np.size(valid), -1, dtype=np.int32)
      n_valid = np.sum(valid)
      renum[valid] = np.arange(n_valid, dtype=np.int32)
      return renum
  
file_path: catboost/contrib/python/matplotlib/py3/matplotlib/tri/_tritools.py
imports: import numpy
  from matplotlib import _api
  from matplotlib.tri import Triangulation
label_desc: Use image node_id 6 for calling the TriAnalyzer obj's underlying member method code with example usage: obj._total_to_compress_renum(valid) and returns: renum