class graphicle.data.ColorArray(graphicle.base.ArrayBase)[source]

Returns data structure of color / anti-color pairs for particle shower.

New in version 0.1.0.

Changed in version 0.2.0: Added internal numpy interfaces for greater interoperability.

Changed in version 0.3.4: Added color and anticolor attributes.

Parameters:
data : ndarray[int32] or ndarray[void]

Data representing the QCD color charge of each particle in the point cloud. Given as either a (n, 2)-dimensional numpy array, or a structured array, with field names ('color', 'anticolor').

Public members

__array__() ndarray[Any, dtype[void]][source]

Numpy array representation of the data.

__repr__() str[source]

Return repr(self).

__iter__() Iterator[ColorElement][source]

Iterator exposing contained data as Python native.

property data : ndarray[Any, dtype[void]][source]

Structured array containing ('color', 'anticolor') values for particle set.

property color : ndarray[Any, dtype[int32]][source]

Color component of the color / anticolor codes.

property anticolor : ndarray[Any, dtype[int32]][source]

Anticolor component of the color / anticolor codes.

copy() ColorArray[source]

Copies the underlying data into a new ColorArray instance.

__getitem__(key) ColorArray[source]
__bool__() bool[source]

Truthy returns False if no elements, True otherwise.

__eq__(other: ArrayBase | ndarray[Any, dtype[Any]]) MaskArray[source]

Equality comparison.

__ne__(other: ArrayBase | ndarray[Any, dtype[Any]]) MaskArray[source]

Non equality comparison.

serialize() tuple[ColorElement, ...][source]

Provides a serialized version of the underlying data.

__setattr__(name, val)[source]

Method generated by attrs for class ColorArray.

ColorArray(...)[source]

Method generated by attrs for class ColorArray.

dtype : dtype[source]
index(value, ...) integer -- return first index of value.[source]

Raises ValueError if the value is not present.

count(value) integer -- return number of occurrences of value[source]
classmethod __subclasshook__(C)[source]

Abstract classes can override this to customize issubclass().

ColorArray = <bound method GenericAlias of <class 'collections.abc.Iterable'>>[source]
__lt__(other)[source]

Return self<value.

__le__(other)[source]

Return self<=value.

__gt__(other)[source]

Return self>value.

__ge__(other)[source]

Return self>=value.

__or__(other)[source]

Return self|value.

__ror__(other)[source]

Return value|self.


Last update: Jun 27, 2025