podpac.coordinates.GroupCoordinates

class podpac.coordinates.GroupCoordinates(**kwargs: Any)[source]

Bases: HasTraits

List of multi-dimensional Coordinates.

GroupCoordinates contains a list of Coordinates containing the same set of unstacked dimensions.

The GroupCoordinates object is list-like and can be indexed, appended, looped, etc like a standard list. The following Coordinates methods are wrapped for convenience:

Parameters:

udims (tuple) – Tuple of shared dimensions.

Alternative Constructors

from_definition(d)

Create a Coordinates group from a group definition.

from_json(s)

Create a Coordinates group from a group JSON definition.

Methods

__init__(coords_list)

Create a Coordinates group.

append(c)

Append Coordinates to the group.

intersect(other[, outer, return_index])

Intersect each Coordinates in the group with the given coordinates.

trait_defaults(*names, **metadata)

Return a trait's default value or a dictionary of them

trait_has_value(name)

Returns True if the specified trait has a value.

trait_values(**metadata)

A dict of trait names and their values.

Attributes

definition

Serializable coordinates group definition.

hash

GroupCoordinates hash.

json

Serialized coordinates group definition.

udims

Tuple of shared dimensions.

Members:

__init__(coords_list)[source]

Create a Coordinates group.

Parameters:

coords_list (list) – list of Coordinates

append(c)[source]

Append Coordinates to the group.

Parameters:

c (Coordinates) – Coordinates to append.

property definition

Serializable coordinates group definition.

The definition can be used to create new GroupCoordinates:

g = podpac.GroupCoordinates([...])
g2 = podpac.GroupCoordinates.from_definition(g.definition)

See also

from_definition, json

classmethod from_definition(d)[source]

Create a Coordinates group from a group definition.

Parameters:

d (list) – group definition

Returns:

Coordinates group

Return type:

CoordinatesGroup

See also

definition, from_json

classmethod from_json(s)[source]

Create a Coordinates group from a group JSON definition.

Parameters:

s (str) – group JSON definition

Returns:

Coordinates group

Return type:

CoordinatesGroup

See also

json

property hash

GroupCoordinates hash.

Note: To be replaced with the __hash__ method.

intersect(other, outer=False, return_index=False)[source]

Intersect each Coordinates in the group with the given coordinates.

Parameters:
  • other (Coordinates1d, StackedCoordinates, Coordinates) – Coordinates to intersect with.

  • outer (bool, optional) – If True, do an outer intersection. Default False.

  • return_index (bool, optional) – If True, return slice or indices for the selection in addition to coordinates. Default False.

Returns:

  • intersections (GroupCoordinates) – Coordinates group consisting of the intersection of each Coordinates.

  • idx (list) – List of lists of indices for each Coordinates item, only if return_index is True.

property json

Serialized coordinates group definition.

The definition can be used to create new GroupCoordinates:

g = podpac.GroupCoordinates(...)
g2 = podpac.GroupCoordinates.from_json(g.json)

See also

json

property udims

Tuple of shared dimensions.

Type:

tuple