class_docstr: Encapsulate InferenceData specific logic.
code: def __init__(
      self,
      *,
      trace=None,
      prior=None,
      posterior_predictive=None,
      log_likelihood=False,
      predictions=None,
      coords: Optional[CoordSpec] = None,
      dims: Optional[DimSpec] = None,
      sample_dims: Optional[List] = None,
      model=None,
      save_warmup: Optional[bool] = None,
      include_transformed: bool = False,
  ):
      self.save_warmup = (
          rcParams["data.save_warmup"]
          if save_warmup is None
          else save_warmup
      )
      self.include_transformed = include_transformed
      self.trace = trace
  
      # this permits us to get the model from command-line argument or from with model:
      self.model = modelcontext(model)
  
      self.attrs = None
      if trace is not None:
          self.nchains = (
              trace.nchains if hasattr(trace, "nchains") else 1
          )
          if (
              hasattr(trace.report, "n_draws")
              and trace.report.n_draws is not None
          ):
              self.ndraws = trace.report.n_draws
              self.attrs = {
                  "sampling_time": trace.report.t_sampling,
                  "tuning_steps": trace.report.n_tune,
              }
          else:
              self.ndraws = len(trace)
              if self.save_warmup:
                  warnings.warn(
                      "Warmup samples will be stored in posterior group and will not be"
                      " excluded from stats and diagnostics."
                      " Do not slice the trace manually before conversion",
                      UserWarning,
                  )
          self.ntune = len(self.trace) - self.ndraws
          self.posterior_trace, self.warmup_trace = self.split_trace()
      else:
          self.nchains = self.ndraws = 0
  
      self.prior = prior
      self.posterior_predictive = posterior_predictive
      self.log_likelihood = log_likelihood
      self.predictions = predictions
  
      if all(
          elem is None
          for elem in (trace, predictions, posterior_predictive, prior)
      ):
          raise ValueError(
              "When constructing InferenceData you must pass at least"
              " one of trace, prior, posterior_predictive or predictions."
          )
  
      user_coords = {} if coords is None else coords
      user_dims = {} if dims is None else dims
      model_coords, model_dims = coords_and_dims_for_inferencedata(
          self.model
      )
      self.coords = {**model_coords, **user_coords}
      self.dims = {**model_dims, **user_dims}
  
      if sample_dims is None:
          sample_dims = ["chain", "draw"]
      self.sample_dims = sample_dims
  
      self.observations = find_observations(self.model)
  
imports: import logging
  import warnings
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union
  import numpy
  from arviz import InferenceData, concat, rcParams
  from arviz.data.base import CoordSpec, DimSpec, dict_to_dataset, requires
  from pytensor.graph.basic import Constant
  from pytensor.tensor.sharedvar import SharedVariable
  import pymc
  from pymc.model import Model, modelcontext
  from pymc.pytensorf import extract_obs_data
  from pymc.util import get_default_varnames
label_desc: Use image node_id 1 to create a new InferenceDataConverter object  with example: obj = InferenceDataConverter()