class documentation

Abstract base class for all aggregations.

Aggregation instances represent an aggregation or reduction of a fiftyone.core.collections.SampleCollection instance.

Parameters
field_or_expra field name, embedded.field.name, fiftyone.core.expressions.ViewExpression, or MongoDB expression defining the field or expression to aggregate
expra fiftyone.core.expressions.ViewExpression or MongoDB expression to apply to field_or_expr (which must be a field) before aggregating
safewhether to ignore nan/inf values when dealing with floating point values
Method __eq__ Undocumented
Method __init__ Undocumented
Method __repr__ Undocumented
Method __str__ Undocumented
Method default_result Returns the default result for this aggregation.
Method parse_result Parses the output of to_mongo.
Method to_mongo Returns the MongoDB aggregation pipeline for this aggregation.
Property expr The expression being computed, if any.
Property field_name The name of the field being computed on, if any.
Property safe Whether nan/inf values will be ignored when dealing with floating point values.
Class Method _from_dict Creates an Aggregation instance from a serialized JSON dict representation of it.
Method _kwargs Returns a list of [name, value] lists describing the parameters of this aggregation instance.
Method _needs_frames Whether the aggregation requires frame labels of video samples to be attached.
Method _needs_group_slices Whether the aggregation requires group slice(s) to be attached.
Method _serialize Returns a JSON dict representation of the Aggregation.
Instance Variable _expr Undocumented
Instance Variable _field_name Undocumented
Instance Variable _safe Undocumented
Instance Variable _uuid Undocumented
Property _has_big_result Whether the aggregation's result is returned across multiple documents.
Property _is_big_batchable Whether the aggregation has big results and its pipeline is defined by a single $project stage and thus can be combined with other such aggregations.
def __eq__(self, other): (source)

Undocumented

def __repr__(self): (source)

Undocumented

def __str__(self): (source)

Undocumented

The name of the field being computed on, if any.

@classmethod
def _from_dict(cls, d): (source)

Creates an Aggregation instance from a serialized JSON dict representation of it.

Parameters
da JSON dict
Returns
an Aggregation
def _needs_frames(self, sample_collection): (source)

Whether the aggregation requires frame labels of video samples to be attached.

Parameters
sample_collectionthe fiftyone.core.collections.SampleCollection to which the aggregation is being applied
Returns
True/False
def _needs_group_slices(self, sample_collection): (source)

Whether the aggregation requires group slice(s) to be attached.

Parameters
sample_collectionthe fiftyone.core.collections.SampleCollection to which the aggregation is being applied
Returns
None, or a list of group slices
def _serialize(self, include_uuid=True): (source)

Returns a JSON dict representation of the Aggregation.

Parameters
include_uuid:Truewhether to include the aggregation's UUID in the JSON representation
Returns
a JSON dict

Undocumented

_field_name = (source)

Undocumented

Undocumented

@property
_has_big_result = (source)

Whether the aggregation's result is returned across multiple documents.

This property affects the data passed to to_mongo at runtime.

@property
_is_big_batchable = (source)

Whether the aggregation has big results and its pipeline is defined by a single $project stage and thus can be combined with other such aggregations.

Aggregation classes for which _is_big_batchable may be True must accept an optional big_field parameter in their to_mongo method that specifies the field name to use in its $project stage.