Skip to content

Commit e5a1fce

Browse files
author
Sean Sullivan
committed
fix lint
1 parent 22bc045 commit e5a1fce

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

elastic_datashader/tilegen.py

+20-19
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,6 @@ def get_span_upper_bound(span_range: str, estimated_points_per_tile: Optional[in
537537
return math.log(1e9)
538538

539539
if span_range == "ultrawide":
540-
return math.log(1e30)
541540
return math.log(1e308)
542541

543542
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_
11781177
bucket.metric("sum","sum",field=category_field,missing=0)
11791178
searches.append(subtile_s)
11801179
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
11991199

12001200
def remap_bucket(bucket,search):
1201+
# pylint: disable=unused-argument
12011202
#get bounds from bucket.key
12021203
#remap sub aggregation for sum of values to the doc count
12031204
bucket.doc_count = bucket.sum['value']

0 commit comments

Comments
 (0)