class_docstr: Encapsulate InferenceData specific logic.
docstr: Convert all available data to an InferenceData object.
  
  Note that if groups can not be created (e.g., there is no `trace`, so
  the `posterior` and `sample_stats` can not be extracted), then the InferenceData
  will not have those groups.
docstr_tok: ["Convert","all","available","data","to","an","InferenceData","object",".","Note","that","if","groups","can","not","be","created","(","e.g.",",","there","is","no","`","trace","`",",","so","the","`","posterior","`","and","`","sample_stats","`","can","not","be","extracted",")",",","then","the","InferenceData","will","not","have","those","groups","."]
code: def to_inference_data(self):
      """Convert all available data to an InferenceData object.
  
      Note that if groups can not be created (e.g., there is no `trace`, so
      the `posterior` and `sample_stats` can not be extracted), then the InferenceData
      will not have those groups.
      """
      id_dict = {
          "posterior": self.posterior_to_xarray(),
          "sample_stats": self.sample_stats_to_xarray(),
          "posterior_predictive": self.posterior_predictive_to_xarray(),
          "predictions": self.predictions_to_xarray(),
          **self.priors_to_xarray(),
          "observed_data": self.observed_data_to_xarray(),
      }
      if self.predictions:
          id_dict[
              "predictions_constant_data"
          ] = self.constant_data_to_xarray()
      else:
          id_dict["constant_data"] = self.constant_data_to_xarray()
      idata = InferenceData(save_warmup=self.save_warmup, **id_dict)
      if self.log_likelihood:
          from pymc.stats.log_likelihood import compute_log_likelihood
  
          idata = compute_log_likelihood(
              idata,
              var_names=None
              if self.log_likelihood is True
              else self.log_likelihood,
              extend_inferencedata=True,
              model=self.model,
              sample_dims=self.sample_dims,
              progressbar=False,
          )
      return idata
  
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 10 for calling the InferenceDataConverter obj's underlying member method code with example usage: obj.to_inference_data() and returns: idata