MCPcopy Index your code
hub / github.com/pydata/xarray / __init__

Method __init__

xarray/core/variable.py:370–404  ·  view source on GitHub ↗

Parameters ---------- dims : str or sequence of str Name(s) of the the data dimension(s). Must be either a string (only for 1D data) or a sequence of strings with length equal to the number of dimensions. data : array_like

(
        self,
        dims,
        data: T_DuckArray | np.typing.ArrayLike,
        attrs=None,
        encoding=None,
        fastpath=False,
    )

Source from the content-addressed store, hash-verified

368 __slots__ = ("_attrs", "_data", "_dims", "_encoding")
369
370 def __init__(
371 self,
372 dims,
373 data: T_DuckArray | np.typing.ArrayLike,
374 attrs=None,
375 encoding=None,
376 fastpath=False,
377 ):
378 """
379 Parameters
380 ----------
381 dims : str or sequence of str
382 Name(s) of the the data dimension(s). Must be either a string (only
383 for 1D data) or a sequence of strings with length equal to the
384 number of dimensions.
385 data : array_like
386 Data array which supports numpy-like data access.
387 attrs : dict_like or None, optional
388 Attributes to assign to the new variable. If None (default), an
389 empty attribute dictionary is initialized.
390 (see FAQ, :ref:`approach to metadata`)
391 encoding : dict_like or None, optional
392 Dictionary specifying how to encode this array's data into a
393 serialized format like netCDF4. Currently used keys (for netCDF)
394 include '_FillValue', 'scale_factor', 'add_offset' and 'dtype'.
395 Well-behaved code to serialize a Variable should ignore
396 unrecognized encoding items.
397 """
398 super().__init__(
399 dims=dims, data=as_compatible_data(data, fastpath=fastpath), attrs=attrs
400 )
401
402 self._encoding: dict[Any, Any] | None = None
403 if encoding is not None:
404 self.encoding = encoding
405
406 def _new(
407 self,

Callers 1

__init__Method · 0.45

Calls 1

as_compatible_dataFunction · 0.85

Tested by

no test coverage detected