Skip to content

Commit

Permalink
Fix bug compression. Activate compression for getCellColorByFeatures.
Browse files Browse the repository at this point in the history
  • Loading branch information
dweemx committed Jul 4, 2018
1 parent 4cc71fb commit be122b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions opt/scopeserver/dataserver/modules/gserver/GServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ def getCellColorByFeatures(self, request, context):
cell_color_by_features.addEmptyFeature()

print("Debug: %s seconds elapsed ---" % (time.time() - start_time))
return s_pb2.CellColorByFeaturesReply(color=cell_color_by_features.get_hex_vec(),
compressedColor=None,
hasAddCompressionLayer=False,
return s_pb2.CellColorByFeaturesReply(color=None,
compressedColor=cell_color_by_features.get_compressed_hex_vec(),
hasAddCompressionLayer=True,
vmax=cell_color_by_features.get_v_max(),
maxVmax=cell_color_by_features.get_max_v_max(),
cellIndices=cell_color_by_features.get_cell_indices())
Expand Down
2 changes: 1 addition & 1 deletion opt/scopeserver/utils/CellColorByFeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_hex_vec(self):

def get_compressed_hex_vec(self):
comp_start_time = time.time()
hex_vec_compressed = CellColorByFeatures.compress_str_array(str_arr=self.hex_vec)
hex_vec_compressed = CellColorByFeatures.compress_str_array(str_arr=self.get_hex_vec())
print("Debug: %s seconds elapsed (compression) ---" % (time.time() - comp_start_time))
return hex_vec_compressed

Expand Down
3 changes: 2 additions & 1 deletion src/components/common/Viewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,8 @@ export default class Viewer extends Component {
if(err) console.log(err)
else {
this.endBenchmark("getFeatureColors")
this.updateColors(response, this.chunkString(uncompressedMessage.toString(), 6))
let colors = this.chunkString(uncompressedMessage.toString(), 6)
this.updateColors(response, colors)
}
});
} else {
Expand Down

0 comments on commit be122b7

Please sign in to comment.