class_docstr: Encapsulate PyStan specific logic.
class_docstr_tok: ["Encapsulate","PyStan","specific","logic","."]
docstr: Extract sample_stats_prior from prior.
code: def sample_stats_prior_to_xarray(self):
      """Extract sample_stats_prior from prior."""
      prior = self.prior
      data, _ = get_sample_stats(prior, warmup=False)
  
      # lp__
      stat_lp, _ = get_draws(
          prior, variables="lp__", warmup=False, dtypes=self.dtypes
      )
      data["lp"] = stat_lp["lp__"]
  
      attrs = get_attrs(prior)
      return dict_to_dataset(
          data,
          library=self.pystan,
          attrs=attrs,
          coords=self.coords,
          dims=self.dims,
      )
  
imports: import re
  from collections import OrderedDict
  from copy import deepcopy
  from math import ceil
  import numpy
  import xarray
  from ..None import _log
  from ..rcparams import rcParams
  from .base import dict_to_dataset, generate_dims_coords, infer_stan_dtypes, make_attrs, requires
  from .inference_data import InferenceData
label_desc: Use image node_id 8 for calling the PyStanConverter obj's underlying member method code with example usage: obj.sample_stats_prior_to_xarray() and returns: dict_to_dataset