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: Create an InferenceData object from a :class:`~datatree.DataTree`.
  
  Parameters
  ----------
  datatree : DataTree
docstr_tok: ["Create","an","InferenceData","object","from","a",":","class",":","`","~datatree.DataTree","`",".","Parameters","--","--","--","--","--","datatree",":","DataTree"]
code: def from_datatree(datatree):
      """Create an InferenceData object from a :class:`~datatree.DataTree`.
  
      Parameters
      ----------
      datatree : DataTree
      """
      return InferenceData(
          **{
              group: sub_dt.to_dataset()
              for group, sub_dt in datatree.items()
          }
      )
  
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 19 for calling the InferenceData obj's underlying member method code with example usage: obj.from_datatree(datatree) and returns: InferenceData