docstr: Class for a vertex cache for a simplicial complex with an associated
  field.
  
  Parameters
  ----------
  field : callable
      Scalar or vector field callable.
  field_args : tuple, optional
      Any additional fixed parameters needed to completely specify the
      field function
  g_cons : dict or sequence of dict, optional
      Constraints definition.
      Function(s) ``R**n`` in the form::
  g_cons_args : tuple, optional
      Any additional fixed parameters needed to completely specify the
      constraint functions
  workers : int  optional
      Uses `multiprocessing.Pool <multiprocessing>`) to compute the field
       functions in parallel.
docstr_tok: ["Class","for","a","vertex","cache","for","a","simplicial","complex","with","an","associated","field",".","Parameters","--","--","--","--","--","field",":","callable","Scalar","or","vector","field","callable",".","field_args",":","tuple",",","optional","Any","additional","fixed","parameters","needed","to","completely","specify","the","field","function","g_cons",":","dict","or","sequence","of","dict",",","optional","Constraints","definition",".","Function","(","s",")","``","R","*","*","n","``","in","the","form",":",":","g_cons_args",":","tuple",",","optional","Any","additional","fixed","parameters","needed","to","completely","specify","the","constraint","functions","workers",":","int","optional","Uses","`","multiprocessing.Pool","<","multiprocessing",">","`",")","to","compute","the","field","functions","in","parallel","."]
code: def __init__(
      self,
      field=None,
      field_args=(),
      g_cons=None,
      g_cons_args=(),
      workers=1,
  ):
      """
      Class for a vertex cache for a simplicial complex with an associated
      field.
  
      Parameters
      ----------
      field : callable
          Scalar or vector field callable.
      field_args : tuple, optional
          Any additional fixed parameters needed to completely specify the
          field function
      g_cons : dict or sequence of dict, optional
          Constraints definition.
          Function(s) ``R**n`` in the form::
      g_cons_args : tuple, optional
          Any additional fixed parameters needed to completely specify the
          constraint functions
      workers : int  optional
          Uses `multiprocessing.Pool <multiprocessing>`) to compute the field
           functions in parallel.
  
      """
      super().__init__()
      self.index = -1
      self.Vertex = VertexScalarField
      self.field = field
      self.field_args = field_args
      self.wfield = FieldWrapper(
          field, field_args
      )  # if workers is not 1
  
      self.g_cons = g_cons
      self.g_cons_args = g_cons_args
      self.wgcons = ConstraintWrapper(g_cons, g_cons_args)
      self.gpool = set()  # A set of tuples to process for feasibility
  
      # Field processing objects
      self.fpool = (
          set()
      )  # A set of tuples to process for scalar function
      self.sfc_lock = False  # True if self.fpool is non-Empty
  
      self.workers = workers
      self._mapwrapper = MapWrapper(workers)
  
      if workers == 1:
          self.process_gpool = self.proc_gpool
          if g_cons is None:
              self.process_fpool = self.proc_fpool_nog
          else:
              self.process_fpool = self.proc_fpool_g
      else:
          self.process_gpool = self.pproc_gpool
          if g_cons is None:
              self.process_fpool = self.pproc_fpool_nog
          else:
              self.process_fpool = self.pproc_fpool_g
  
imports: import collections
  from abc import ABC, abstractmethod
  import numpy
  from scipy._lib._util import MapWrapper
label_desc: Use image node_id 1 to create a new VertexCacheField object from inherited base classes: VertexCacheBase with example: obj = VertexCacheField(field, field_args, g_cons, g_cons_args, workers)