Commit 55a7f6e0 authored by Marc Duez's avatar Marc Duez

fuse.py : debug seg_stat with fuse.py

parent 1829e654
......@@ -157,10 +157,8 @@ JsonArray WindowsStorage::sortedWindowsToJsonArray(map <junction, JsonList> json
{
JsonList windowsList;
//JsonArray normalization_ratios = json_normalization(norm_list, it->second,
// nb_segmented);
JsonArray json_size;
JsonArray json_seg;
json_size.add(it->second);
if (json_data_segment.find(it->first) != json_data_segment.end()){
......@@ -170,11 +168,11 @@ JsonArray WindowsStorage::sortedWindowsToJsonArray(map <junction, JsonList> json
}
windowsList.add("window", it->first);
windowsList.add("size", json_size);
//windowsList.add("ratios", normalization_ratios);
windowsList.add("top", top++);
windowsList.add("id", this->getId(it->first));
JsonList seg_stat = this->statusToJson(it->first);
windowsList.add("seg_stat", seg_stat);
json_seg.add(seg_stat);
windowsList.add("seg_stat", json_seg);
windowsArray.add(windowsList);
}
......
......@@ -1670,13 +1670,21 @@ Model.prototype = {
//segmentation info
html += "<tr><td class='header' colspan='" + (time_length + 1) + "'> segmentation information</td></tr>"
html += "<tr><td> segmented </td><td colspan='" + time_length + "'>" + this.getStatus(id) + "</td></tr>"
var total_stat = 0;
for (var key in this.windows[id].seg_stat) total_stat += this.windows[id].seg_stat[key]
for (var key in this.windows[id].seg_stat){
html += "<tr><td> "+this.segmented_mesg[key]+" </td><td colspan='" + time_length + "'>"
+ this.windows[id].seg_stat[key] + " (" + ((this.windows[id].seg_stat[key]/total_stat) * 100)
.toFixed(1) + " %) </td></tr>"
var total_stat = [];
for (var i=0; i<this.windows[id].seg_stat.length; i++) total_stat[i] = 0
for (var i=0; i<this.windows[id].seg_stat.length; i++){
for (var key in this.windows[id].seg_stat[i]) total_stat[i] += this.windows[id].seg_stat[i][key]
}
for (var key in this.windows[id].seg_stat[0]){
html += "<tr><td> "+this.segmented_mesg[key]+"</td>"
for (var i = 0; i < time_length; i++) {
html += "<td>"+this.windows[id].seg_stat[i][key]
+ " (" + ((this.windows[id].seg_stat[i][key]/total_stat[i]) * 100).toFixed(1) + " %)</td>"
}
}
html += "<tr><td> sequence </td><td colspan='" + time_length + "'>" + this.windows[id].sequence + "</td></tr>"
html += "<tr><td> window </td><td colspan='" + time_length + "'>" + this.windows[id].window + "</td></tr>"
html += "<tr><td> V </td><td colspan='" + time_length + "'>" + this.windows[id].V + "</td></tr>"
......
......@@ -400,6 +400,7 @@ class ListWindows:
return result
raise TypeError(repr(obj) + " fail !")
if isinstance(obj, Window):
result = {}
for key in obj.d :
......@@ -407,7 +408,14 @@ class ListWindows:
return result
raise TypeError(repr(obj) + " fail !")
if isinstance(obj, dict):
result = {}
for key in obj :
result[key]= obj[key]
return result
raise TypeError(repr(obj) + " fail !")
def toPython(self, obj_dict):
'''Reverse serializer for json module'''
......@@ -426,6 +434,12 @@ class ListWindows:
for key in obj_dict :
obj.d[key]=obj_dict[key]
return obj
if not "window" in obj_dict and not "reads_segmented" in obj_dict:
res = {}
for key in obj_dict :
res[key]=obj_dict[key]
return res
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment