class_docstr: Encapsulate CmdStanPy specific logic.
docstr: Convert all available data to an InferenceData object.
  
  Note that if groups can not be created (i.e., there is no `output`, 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 (i.e., there is no `output`, so
      the `posterior` and `sample_stats` can not be extracted), then the InferenceData
      will not have those groups.
      """
      return InferenceData(
          save_warmup=self.save_warmup,
          **{
              "posterior": self.posterior_to_xarray(),
              "sample_stats": self.sample_stats_to_xarray(),
              "posterior_predictive": self.posterior_predictive_to_xarray(),
              "predictions": self.predictions_to_xarray(),
              "prior": self.prior_to_xarray(),
              "sample_stats_prior": self.sample_stats_prior_to_xarray(),
              "prior_predictive": self.prior_predictive_to_xarray(),
              "observed_data": self.observed_data_to_xarray(),
              "constant_data": self.constant_data_to_xarray(),
              "predictions_constant_data": self.predictions_constant_data_to_xarray(),
              "log_likelihood": self.log_likelihood_to_xarray(),
          },
      )
  
imports: import logging
  import re
  from collections import defaultdict
  from copy import deepcopy
  from pathlib import Path
  import numpy
  from ..rcparams import rcParams
  from .base import dict_to_dataset, infer_stan_dtypes, make_attrs, requires
  from .inference_data import InferenceData
label_desc: Use image node_id 15 for calling the CmdStanPyConverter obj's underlying member method code with example usage: obj.to_inference_data() and returns: InferenceData