update

function of dascore.proc.basic source

update(
    self: Patch ,
    data: ndarray | None = None,
    coords: collections.abc.Mapping[collections.abc.Mapping[str, Any], CoordManager, None] = None,
    dims: collections.abc.Sequence[collections.abc.Sequence[str], None] = None,
    attrs: collections.abc.Mapping | dascore.core.attrs.PatchAttrs | None[Mapping, PatchAttrs, None] = None,
    dtype: Any = None,
    source: dascore.core.source.ArraySource | None[ArraySource, None] = None,
)-> ‘PatchType’

Return a copy of the Patch with updated data, coords, dims, or attrs.

The kind is preserved: a patch gives back a patch, and a PatchMeta gives back metadata. Use to_patch to give metadata data.

Parameters

Parameter Description
data An array-like containing data, an xarray DataArray object, or a
Patch. Metadata holds none, so giving it data here is an error.
coords The coordinates, or dimensional labels for the data. These can be
passed in three forms:
{coord_name: data}
{coord_name: ((dimensions,), data)}
{coord_name: (dimensions, data)}
dims A sequence of dimension strings. The first entry corresponds to the
first axis of data, the second to the second dimension, and so on.
attrs Optional attributes (non-coordinate metadata) passed as a dict.
dtype The dtype of the data. Metadata, which holds none, takes the one it
is given; a patch checks its data against it.
source Internal I/O source metadata. If omitted, retain the current source.