@@ -537,7 +537,6 @@ def get_span_upper_bound(span_range: str, estimated_points_per_tile: Optional[in
537
537
return math .log (1e9 )
538
538
539
539
if span_range == "ultrawide" :
540
- return math .log (1e30 )
541
540
return math .log (1e308 )
542
541
543
542
assert estimated_points_per_tile is not None
@@ -1178,26 +1177,28 @@ def generate_tile(idx, x, y, z, headers, params, tile_width_px=256, tile_height_
1178
1177
bucket .metric ("sum" ,"sum" ,field = category_field ,missing = 0 )
1179
1178
searches .append (subtile_s )
1180
1179
cmap = "bmy" #todo have front end pass the cmap for none categorical
1181
- def calc_aggregation (bucket ,search ):
1182
- #get bounds from bucket.key
1183
- #do search for sum of values on category_field
1184
- z , x , y = [ int (x ) for x in bucket .key .split ("/" ) ]
1185
- bucket_bb_dict = create_bounding_box_for_tile (x , y , z )
1186
- subtile_s = copy .copy (base_s )
1187
- subtile_s .aggs .bucket ("sum" ,"avg" ,field = category_field ,missing = 0 )
1188
- subtile_s = subtile_s [0 :0 ]
1189
- subtile_s = subtile_s .filter ("geo_bounding_box" , ** {geopoint_field : bucket_bb_dict })
1190
- response = subtile_s .execute ()
1191
- search .num_searches += 1
1192
- search .total_took += response .took
1193
- search .total_shards += response ._shards .total # pylint: disable=W0212
1194
- search .total_skipped += response ._shards .skipped # pylint: disable=W0212
1195
- search .total_successful += response ._shards .successful # pylint: disable=W0212
1196
- search .total_failed += response ._shards .failed # pylint: disable=W0212
1197
- bucket .doc_count = response .aggregations .sum ['value' ] #replace with sum of category_field
1198
- return bucket
1180
+
1181
+ # def calc_aggregation(bucket,search):
1182
+ # #get bounds from bucket.key
1183
+ # #do search for sum of values on category_field
1184
+ # z, x, y = [ int(x) for x in bucket.key.split("/") ]
1185
+ # bucket_bb_dict = create_bounding_box_for_tile(x, y, z)
1186
+ # subtile_s = copy.copy(base_s)
1187
+ # subtile_s.aggs.bucket("sum","avg",field=category_field,missing=0)
1188
+ # subtile_s = subtile_s[0:0]
1189
+ # subtile_s = subtile_s.filter("geo_bounding_box", **{geopoint_field: bucket_bb_dict})
1190
+ # response = subtile_s.execute()
1191
+ # search.num_searches += 1
1192
+ # search.total_took += response.took
1193
+ # search.total_shards += response._shards.total # pylint: disable=W0212
1194
+ # search.total_skipped += response._shards.skipped # pylint: disable=W0212
1195
+ # search.total_successful += response._shards.successful # pylint: disable=W0212
1196
+ # search.total_failed += response._shards.failed # pylint: disable=W0212
1197
+ # bucket.doc_count = response.aggregations.sum['value'] #replace with sum of category_field
1198
+ # return bucket
1199
1199
1200
1200
def remap_bucket (bucket ,search ):
1201
+ # pylint: disable=unused-argument
1201
1202
#get bounds from bucket.key
1202
1203
#remap sub aggregation for sum of values to the doc count
1203
1204
bucket .doc_count = bucket .sum ['value' ]
0 commit comments