Skip to content

Commit

Permalink
docs and file cleaning
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Bu <acb256@cornell.edu>
  • Loading branch information
buman56 committed May 6, 2019
1 parent 721106a commit b3bd354
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
11 changes: 11 additions & 0 deletions python/src/main/python/pygw/base_models.py
Expand Up @@ -246,6 +246,17 @@ def query_statistics(self, q):
# TODO
raise NotImplementedError

"""
Get a single statistical result that matches the given query criteria
Args:
q (pygw.special_queries.StatisticsQuery): query the query criteria, use StatisticsQueryBuilder or its extensions and if you're
interested in a particular common statistics type use StatisticsQueryBuilder.factory()
Returns:
If the query does not define that statistics type it will return null as aggregation
only makes sense within a single type, otherwise aggregates the results of the query
into a single result that is returned
"""
def aggregate_statistics(self, q):
return self._java_ref.aggregateStatistics(q._java_ref)

Expand Down
13 changes: 0 additions & 13 deletions python/src/main/python/pygw/simple_test.py

This file was deleted.

10 changes: 8 additions & 2 deletions python/src/main/python/pygw/special_queries.py
Expand Up @@ -2,12 +2,18 @@
from pygw.base_models import PyGwJavaWrapper, QueryInterface

class StatisticsQuery(QueryInterface):
"type is 'bbox' or 'time_range'"
"""
Builds a statistics query for aggregate statistics.
To create a StatisticsQuery, for extended_id is the ID of the statisticqs query,
and type must either be 'bbox' 'time_range'
"""
def __init__(self, extended_id, type):
if type == "bbox":
builder = config.MODULE__geotime_query.VectorStatisticsQueryBuilder.newBuilder().factory().bbox()
else:
elif type == "time_range":
builder = config.MODULE__geotime_query.VectorStatisticsQueryBuilder.newBuilder().factory().timeRange()
else:
raise AttributeError("Invalid query type")

builder.fieldName(extended_id)
java_ref = builder.build()
Expand Down

0 comments on commit b3bd354

Please sign in to comment.