class_docstr: Container for inference data storage using xarray.
  
  For a detailed introduction to ``InferenceData`` objects and their usage, see
  :ref:`xarray_for_arviz`. This page provides help and documentation
  on ``InferenceData`` methods and their low level implementation.
class_docstr_tok: ["Container","for","inference","data","storage","using","xarray",".","For","a","detailed","introduction","to","``","InferenceData","``","objects","and","their","usage",",","see",":","ref",":","`","xarray_for_arviz","`",".","This","page","provides","help","and","documentation","on","``","InferenceData","``","methods","and","their","low","level","implementation","."]
docstr: Perform xarray renaming of dimensions on all groups.
  
  Loops groups to perform Dataset.rename_dims(name_dict)
  for every key in name_dict if key is a dimension of the dataset.
  The renaming is performed on all relevant groups (like
  posterior, prior, sample stats) while non relevant groups like observed data are
  omitted. See :meth:`xarray:xarray.Dataset.rename_dims`
  
  Parameters
  ----------
  name_dict : dict
      Dictionary whose keys are current dimension names and whose values are the desired
      names.
  groups : str or list of str, optional
      Groups where the selection is to be applied. Can either be group names
      or metagroup names.
  filter_groups : {None, "like", "regex"}, optional
      If `None` (default), interpret groups as the real group or metagroup names.
      If "like", interpret groups as substrings of the real group or metagroup names.
      If "regex", interpret groups as regular expressions on the real group or
      metagroup names. A la `pandas.filter`.
  inplace : bool, optional
      If ``True``, modify the InferenceData object inplace,
      otherwise, return the modified copy.
  
  Returns
  -------
  InferenceData
      A new InferenceData object with renamed dimension by default.
      When `inplace==True` perform renaming in-place and return `None`
  
  Examples
  --------
  Use ``rename_dims`` to renaming of dimensions on all groups of the InferenceData
  object. We first check the dimensions of original object:
  
  .. jupyter-execute::
  
      import arviz as az
      idata = az.load_arviz_data("rugby")
      idata
  
  In order to rename the dimensions, we use:
  
  .. jupyter-execute::
  
      idata.rename_dims({"team": "team_new"}, inplace=True)
      idata
  
  See Also
  --------
  xarray.Dataset.rename_dims : Returns a new object with renamed dimensions only.
  rename :
      Perform xarray renaming of variable and dimensions on all groups of an InferenceData
      object.
  rename_vars :
      Perform xarray renaming of variable or coordinate names on all groups of an
      InferenceData object.
docstr_tok: ["Perform","xarray","renaming","of","dimensions","on","all","groups",".","Loops","groups","to","perform","Dataset.rename_dims","(","name_dict",")","for","every","key","in","name_dict","if","key","is","a","dimension","of","the","dataset",".","The","renaming","is","performed","on","all","relevant","groups","(","like","posterior",",","prior",",","sample","stats",")","while","non","relevant","groups","like","observed","data","are","omitted",".","See",":","meth",":","`","xarray",":","xarray.Dataset.rename_dims","`","Parameters","--","--","--","--","--","name_dict",":","dict","Dictionary","whose","keys","are","current","dimension","names","and","whose","values","are","the","desired","names",".","groups",":","str","or","list","of","str",",","optional","Groups","where","the","selection","is","to","be","applied",".","Can","either","be","group","names","or","metagroup","names",".","filter_groups",":","{","None",",","``","like","''",",","``","regex","''","}",",","optional","If","`","None","`","(","default",")",",","interpret","groups","as","the","real","group","or","metagroup","names",".","If","``","like","''",",","interpret","groups","as","substrings","of","the","real","group","or","metagroup","names",".","If","``","regex","''",",","interpret","groups","as","regular","expressions","on","the","real","group","or","metagroup","names",".","A","la","`","pandas.filter","`",".","inplace",":","bool",",","optional","If","``","True","``",",","modify","the","InferenceData","object","inplace",",","otherwise",",","return","the","modified","copy",".","Returns","--","--","--","-","InferenceData","A","new","InferenceData","object","with","renamed","dimension","by","default",".","When","`","inplace==True","`","perform","renaming","in-place","and","return","`","None","`","Examples","--","--","--","--","Use","``","rename_dims","``","to","renaming","of","dimensions","on","all","groups","of","the","InferenceData","object",".","We","first","check","the","dimensions","of","original","object",":","..","jupyter-execute",":",":","import","arviz","as","az","idata","=","az.load_arviz_data","(","``","rugby","''",")","idata","In","order","to","rename","the","dimensions",",","we","use",":","..","jupyter-execute",":",":","idata.rename_dims","(","{","``","team","''",":","``","team_new","''","}",",","inplace=True",")","idata","See","Also","--","--","--","--","xarray.Dataset.rename_dims",":","Returns","a","new","object","with","renamed","dimensions","only",".","rename",":","Perform","xarray","renaming","of","variable","and","dimensions","on","all","groups","of","an","InferenceData","object",".","rename_vars",":","Perform","xarray","renaming","of","variable","or","coordinate","names","on","all","groups","of","an","InferenceData","object","."]
code: def rename_dims(
      self,
      name_dict=None,
      groups=None,
      filter_groups=None,
      inplace=False,
  ):
      """Perform xarray renaming of dimensions on all groups.
  
      Loops groups to perform Dataset.rename_dims(name_dict)
      for every key in name_dict if key is a dimension of the dataset.
      The renaming is performed on all relevant groups (like
      posterior, prior, sample stats) while non relevant groups like observed data are
      omitted. See :meth:`xarray:xarray.Dataset.rename_dims`
  
      Parameters
      ----------
      name_dict : dict
          Dictionary whose keys are current dimension names and whose values are the desired
          names.
      groups : str or list of str, optional
          Groups where the selection is to be applied. Can either be group names
          or metagroup names.
      filter_groups : {None, "like", "regex"}, optional
          If `None` (default), interpret groups as the real group or metagroup names.
          If "like", interpret groups as substrings of the real group or metagroup names.
          If "regex", interpret groups as regular expressions on the real group or
          metagroup names. A la `pandas.filter`.
      inplace : bool, optional
          If ``True``, modify the InferenceData object inplace,
          otherwise, return the modified copy.
  
      Returns
      -------
      InferenceData
          A new InferenceData object with renamed dimension by default.
          When `inplace==True` perform renaming in-place and return `None`
  
      Examples
      --------
      Use ``rename_dims`` to renaming of dimensions on all groups of the InferenceData
      object. We first check the dimensions of original object:
  
      .. jupyter-execute::
  
          import arviz as az
          idata = az.load_arviz_data("rugby")
          idata
  
      In order to rename the dimensions, we use:
  
      .. jupyter-execute::
  
          idata.rename_dims({"team": "team_new"}, inplace=True)
          idata
  
      See Also
      --------
      xarray.Dataset.rename_dims : Returns a new object with renamed dimensions only.
      rename :
          Perform xarray renaming of variable and dimensions on all groups of an InferenceData
          object.
      rename_vars :
          Perform xarray renaming of variable or coordinate names on all groups of an
          InferenceData object.
      """
      groups = self._group_names(groups, filter_groups)
      if "chain" in name_dict.keys() or "draw" in name_dict.keys():
          raise KeyError(
              "'chain' or 'draw' dimensions can't be renamed"
          )
  
      out = self if inplace else deepcopy(self)
      for group in groups:
          dataset = getattr(self, group)
          valid_keys = set(name_dict.keys()).intersection(dataset.dims)
          dataset = dataset.rename_dims(
              {key: name_dict[key] for key in valid_keys}
          )
          setattr(out, group, dataset)
      if inplace:
          return None
      else:
          return out
  
imports: import os
  import re
  import sys
  import uuid
  import warnings
  from collections import OrderedDict, defaultdict
  from collections.abc import MutableMapping, Sequence
  from copy import copy
  from copy import deepcopy
  from datetime import datetime
  from html import escape
  from typing import TYPE_CHECKING, Any, Iterable, Iterator, List, Mapping, Optional, Tuple, TypeVar, Union, overload
  import numpy
  import xarray
  from packaging import version
  from ..rcparams import rcParams
  from ..utils import HtmlTemplate, _subset_list, _var_names, either_dict_or_kwargs
  from .base import _extend_xr_method, _make_json_serializable, dict_to_dataset
label_desc: Use image node_id 32 for calling the InferenceData obj's underlying member method code with example usage: obj.rename_dims(name_dict, groups, filter_groups, inplace) and returns: None, out