scipp.Coords#

class scipp.Coords#

dict-like collection of meta data

Returned by DataArray.coords(), DataArray.attrs(), DataArray.meta(), and the corresponding properties of Dataset.

__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

clear(self)

copy(self[, deep])

Return a (by default deep) copy.

get

Get the value associated with the provided key or the default value.

is_edges(self, key[, dim])

Return True if the given key contains bin-edges in the given dim.

items(self)

view on self's items

keys(self)

view on self's keys

pop

Remove and return an element.

popitem(self)

set_aligned(self, key, aligned)

update(self[, other])

Update items from dict-like or iterable.

values(self)

view on self's values

__getitem__(self: scipp._scipp.core.Coords, arg0: str) scipp._scipp.core.Variable#
clear(self: scipp._scipp.core.Coords) None#
copy(self: scipp._scipp.core.Coords, deep: bool = True) scipp._scipp.core.Coords#

Return a (by default deep) copy.

If deep=True (the default), a deep copy is made. Otherwise, a shallow copy is made, and the returned data (and meta data) values are new views of the data and meta data values of this object.

get()#

Get the value associated with the provided key or the default value.

is_edges(self: scipp._scipp.core.Coords, key: str, dim: str | None = None) bool#

Return True if the given key contains bin-edges in the given dim.

items(self: scipp._scipp.core.Coords) scipp._scipp.core.Coords_items_view#

view on self’s items

keys(self: scipp._scipp.core.Coords) scipp._scipp.core.Coords_keys_view#

view on self’s keys

pop()#

Remove and return an element.

If key is not found, default is returned if given, otherwise KeyError is raised.

popitem(self: scipp._scipp.core.Coords) tuple[str, scipp._scipp.core.Variable]#
set_aligned(self: scipp._scipp.core.Coords, key: str, aligned: bool) None#
update(self: scipp._scipp.core.Coords, other: object = None, /, **kwargs) None#

Update items from dict-like or iterable.

If other has a .keys() method, then update does: for k in other.keys(): self[k] = other[k].

If other is given but does not have a .keys() method, then update does: for k, v in other: self[k] = v.

In either case, this is followed by: for k in kwargs: self[k] = kwargs[k].

See also

dict.update

values(self: scipp._scipp.core.Coords) scipp._scipp.core.Coords_values_view#

view on self’s values