class_docstr: Encapsulate CmdStan specific logic.
class_docstr_tok: ["Encapsulate","CmdStan","specific","logic","."]
docstr: Convert constant data to xarray.
docstr_tok: ["Convert","constant","data","to","xarray","."]
code: def constant_data_to_xarray(self):
      """Convert constant data to xarray."""
      constant_data_raw = _read_data(self.constant_data)
      variables = self.constant_data_var
      if isinstance(variables, str):
          variables = [variables]
      constant_data = {
          key: utils.one_de(vals)
          for key, vals in constant_data_raw.items()
          if variables is None or key in variables
      }
      return dict_to_dataset(
          constant_data,
          coords=self.coords,
          dims=self.dims,
          default_dims=[],
          index_origin=self.index_origin,
      )
  
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 13 for calling the CmdStanConverter obj's underlying member method code with example usage: obj.constant_data_to_xarray() and returns: dict_to_dataset