class_docstr: Encapsulate Bean Machine specific logic.
code: def __init__(
      self,
      *,
      sampler=None,
      coords=None,
      dims=None,
  ) -> None:
      self.sampler = sampler
      self.coords = coords
      self.dims = dims
  
      import beanmachine.ppl as bm  # pylint: disable=import-error
  
      self.beanm = bm
  
      if "posterior" in self.sampler.namespaces:
          self.posterior = self.sampler.namespaces["posterior"].samples
      else:
          self.posterior = None
  
      if "posterior_predictive" in self.sampler.namespaces:
          self.posterior_predictive = self.sampler.namespaces[
              "posterior_predictive"
          ].samples
      else:
          self.posterior_predictive = None
  
      if self.sampler.log_likelihoods is not None:
          self.log_likelihoods = self.sampler.log_likelihoods
      else:
          self.log_likelihoods = None
  
      if self.sampler.observations is not None:
          self.observations = self.sampler.observations
      else:
          self.observations = None
  
file_path: arviz/arviz/data/io_beanmachine.py
imports: from .inference_data import InferenceData
  from .base import dict_to_dataset, requires
label_desc: Use image node_id 1 to create a new BMConverter object  with example: obj = BMConverter()