class_docstr: CmdStanPy sampling wrapper base class.
  
  See the documentation on  :class:`~arviz.SamplingWrapper` for a more detailed
  description. An example of ``CmdStanPySamplingWrapper`` usage can be found
  in the :ref:`cmdstanpy_refitting` notebook.
  
  Warnings
  --------
  Sampling wrappers are an experimental feature in a very early stage. Please use them
  with caution.
class_docstr_tok: ["CmdStanPy","sampling","wrapper","base","class",".","See","the","documentation","on",":","class",":","`","~arviz.SamplingWrapper","`","for","a","more","detailed","description",".","An","example","of","``","CmdStanPySamplingWrapper","``","usage","can","be","found","in","the",":","ref",":","`","cmdstanpy_refitting","`","notebook",".","Warnings","--","--","--","--","Sampling","wrappers","are","an","experimental","feature","in","a","very","early","stage",".","Please","use","them","with","caution","."]
docstr: Resample cmdstanpy model on modified_observed_data.
docstr_tok: ["Resample","cmdstanpy","model","on","modified_observed_data","."]
code: def sample(self, modified_observed_data):
      """Resample cmdstanpy model on modified_observed_data."""
      from cmdstanpy import write_stan_json
  
      write_stan_json(self.data_file, modified_observed_data)
      fit = self.model.sample(
          **{**self.sample_kwargs, "data": self.data_file}
      )
      return fit
  
file_path: arviz/arviz/wrappers/wrap_stan.py
imports: from typing import Union
  from ..data import from_cmdstanpy, from_pystan
  from .base import SamplingWrapper
label_desc: Use image node_id 2 for calling the CmdStanPySamplingWrapper obj's underlying member method code with example usage: obj.sample(modified_observed_data) and returns: fit