fiftyone.server.routes.aggregations¶
FiftyOne Server /aggregation and /tagging routes
Classes:
|
|
|
Named helper aggregation for counting existence |
Functions:
|
Builds and executes the aggregations required by App components |
-
class
fiftyone.server.routes.aggregations.
CountExists
(field)¶ Bases:
fiftyone.core.aggregations.Count
Named helper aggregation for counting existence
Methods:
Returns the default result for this aggregation.
parse_result
(d)Parses the output of
to_mongo()
.to_mongo
(sample_collection)Returns the MongoDB aggregation pipeline for this aggregation.
Attributes:
The expression being computed, if any.
The name of the field being computed on, if any.
Whether nan/inf values will be ignored when dealing with floating point values.
-
default_result
()¶ Returns the default result for this aggregation.
- Returns
0
-
property
expr
¶ The expression being computed, if any.
-
property
field_name
¶ The name of the field being computed on, if any.
-
parse_result
(d)¶ Parses the output of
to_mongo()
.- Parameters
d – the result dict
- Returns
the count
-
property
safe
¶ Whether nan/inf values will be ignored when dealing with floating point values.
-
to_mongo
(sample_collection)¶ Returns the MongoDB aggregation pipeline for this aggregation.
- Parameters
sample_collection – the
fiftyone.core.collections.SampleCollection
to which the aggregation is being applied- Returns
a MongoDB aggregation pipeline (list of dicts)
-
-
class
fiftyone.server.routes.aggregations.
Aggregations
(scope: MutableMapping[str, Any], receive: Callable[[], Awaitable[MutableMapping[str, Any]]], send: Callable[[MutableMapping[str, Any]], Awaitable[None]])¶ Bases:
starlette.endpoints.HTTPEndpoint
Methods:
dispatch
()method_not_allowed
(request)post
(request, *args)-
async
post
(request: starlette.requests.Request, *args) → Union[dict, starlette.responses.Response]¶
-
async
dispatch
() → None¶
-
async
method_not_allowed
(request: starlette.requests.Request) → starlette.responses.Response¶
-
async