class_docstr: PyMC model-fitting backend.
class_docstr_tok: ["PyMC","model-fitting","backend","."]
docstr: Compile the PyMC model from an abstract model specification.
  
  Parameters
  ----------
  spec: bambi.Model
      A Bambi ``Model`` instance containing the abstract specification of the model
      to compile.
docstr_tok: ["Compile","the","PyMC","model","from","an","abstract","model","specification",".","Parameters","--","--","--","--","--","spec",":","bambi.Model","A","Bambi","``","Model","``","instance","containing","the","abstract","specification","of","the","model","to","compile","."]
code: def build(self, spec):
      """Compile the PyMC model from an abstract model specification.
  
      Parameters
      ----------
      spec: bambi.Model
          A Bambi ``Model`` instance containing the abstract specification of the model
          to compile.
      """
      self.model = pm.Model()
      self.components = {}
  
      for (
          name,
          values,
      ) in spec.response_component.response_term.coords.items():
          if name not in self.model.coords:
              self.model.add_coords({name: values})
  
      with self.model:
          for name, component in spec.constant_components.items():
              self.components[name] = ConstantComponent(component)
              self.components[name].build(self, spec)
  
          for name, component in spec.distributional_components.items():
              self.components[name] = DistributionalComponent(component)
              self.components[name].build(self, spec)
  
          self.build_response(spec)
          self.build_potentials(spec)
  
      self.spec = spec
  
imports: import functools
  import logging
  import traceback
  from copy import deepcopy
  from importlib.metadata import version
  import numpy
  import pymc
  import pytensor.tensor
  from pytensor.tensor.special import softmax
  from bambi.backend.links import cloglog, identity, inverse_squared, logit, probit, arctan_2
  from bambi.backend.model_components import ConstantComponent, DistributionalComponent
  from bambi.utils import get_aliased_name
label_desc: Use image node_id 2 for calling the PyMCModel obj's underlying member method code with example usage: obj.build(spec) without return types