class_docstr: Encapsulate CmdStan specific logic.
class_docstr_tok: ["Encapsulate","CmdStan","specific","logic","."]
code: def __init__(
      self,
      *,
      posterior=None,
      posterior_predictive=None,
      predictions=None,
      prior=None,
      prior_predictive=None,
      observed_data=None,
      observed_data_var=None,
      constant_data=None,
      constant_data_var=None,
      predictions_constant_data=None,
      predictions_constant_data_var=None,
      log_likelihood=None,
      index_origin=None,
      coords=None,
      dims=None,
      disable_glob=False,
      save_warmup=None,
      dtypes=None,
  ):
      self.posterior_ = check_glob(posterior, "posterior", disable_glob)
      self.posterior_predictive = check_glob(
          posterior_predictive, "posterior_predictive", disable_glob
      )
      self.predictions = check_glob(
          predictions, "predictions", disable_glob
      )
      self.prior_ = check_glob(prior, "prior", disable_glob)
      self.prior_predictive = check_glob(
          prior_predictive, "prior_predictive", disable_glob
      )
      self.log_likelihood = check_glob(
          log_likelihood, "log_likelihood", disable_glob
      )
      self.observed_data = observed_data
      self.observed_data_var = observed_data_var
      self.constant_data = constant_data
      self.constant_data_var = constant_data_var
      self.predictions_constant_data = predictions_constant_data
      self.predictions_constant_data_var = predictions_constant_data_var
      self.coords = coords if coords is not None else {}
      self.dims = dims if dims is not None else {}
  
      self.posterior = None
      self.prior = None
      self.attrs = None
      self.attrs_prior = None
  
      self.save_warmup = (
          rcParams["data.save_warmup"]
          if save_warmup is None
          else save_warmup
      )
      self.index_origin = index_origin
  
      if dtypes is None:
          dtypes = {}
      elif isinstance(dtypes, str):
          dtypes_path = Path(dtypes)
          if dtypes_path.exists():
              with dtypes_path.open("r", encoding="UTF-8") as f_obj:
                  model_code = f_obj.read()
          else:
              model_code = dtypes
  
          dtypes = infer_stan_dtypes(model_code)
  
      self.dtypes = dtypes
  
      # populate posterior and sample_stats
      self._parse_posterior()
      self._parse_prior()
  
      if (
          self.log_likelihood is None
          and self.posterior_ is not None
          and any(
              name.split(".")[0] == "log_lik"
              for name in self.posterior_columns
          )
      ):
          self.log_likelihood = ["log_lik"]
      elif isinstance(self.log_likelihood, bool):
          self.log_likelihood = None
  
imports: import logging
  import os
  import re
  from collections import defaultdict
  from glob import glob
  from pathlib import Path
  from typing import Dict, List, Optional, Union
  import numpy
  from ..None import utils
  from ..rcparams import rcParams
  from .base import CoordSpec, DimSpec, dict_to_dataset, infer_stan_dtypes, requires
  from .inference_data import InferenceData
label_desc: Use image node_id 1 to create a new CmdStanConverter object  with example: obj = CmdStanConverter()