1 from __future__
import print_function
2 from __future__
import absolute_import
14 from builtins
import range
15 from os
import chdir,getcwd,listdir,makedirs
16 from os.path
import basename,join,exists
22 from ROOT
import TCanvas,gStyle,TH1F,TGaxis,gPad,kRed
28 if "RELMON_SA" in os.environ:
29 from .dirstructure
import Comparison,Directory
30 from .definitions
import *
31 from .utils
import unpickler
33 from Utilities.RelMon.dirstructure
import Comparison,Directory
35 from Utilities.RelMon.utils
import unpickler
40 for old,new
in url_encode_dict.items():
41 url=url.replace(old,new)
45 return "w=%s;h=%s" %(h,w)
49 obj_url=
"archive/%s/%s/%s/%s/" %(run,sample,version,tier)
51 while obj_url.endswith(slash):
53 while slash*2
in obj_url:
54 obj_url=obj_url.replace(slash*2,slash)
58 obj_url=
"obj=%s;" %
build_obj_addr(run,sample,version,plot_path,tier)
61 def fairy_url(run1,run2,sample1,sample2,version1,version2,plot_path,tier1,tier2,draw_opts="",h=250,w=200):
62 fairy_url =
"%s/%s/plotfairy/overlay?" %(server,base_url)
63 fairy_url+=
build_obj(run1,sample1,version1,plot_path,tier1)
64 fairy_url+=
build_obj(run2,sample2,version2,plot_path,tier2)
66 fairy_url+=
"drawopts=%s;" %draw_opts
68 fairy_url +=
";ref=ratiooverlay" 72 fairy_url =
"%s/%s/plotfairy/" %(server,base_url)
76 fairy_url+=
"drawopts=%s;" %draw_opts
80 style_location=
"/cms-service-reldqm" 82 style_location=
"/cms-service-reldqm" 84 style_location =
"http://cms-service-reldqm.web.cern.ch/" + style_location +
"/" 87 if directory!=
None and len(directory.comparisons)>0:
89 style=
'img.fail {border:1px solid #ff0000;}\n'+\
90 'img.succes {border:1px solid #00ff00;}\n'+\
91 'img.null {border:1px solid #ffff00;}\n'+\
92 'img.skiped {border:1px solid #7a7a7a;}\n'+\
93 'a.black_link:link {color: #333333}\n'+\
94 'a.black_link:hover {color: #737373}\n'+\
95 'a.black_link:visited {color: #333333}\n'+\
96 'a.black_link:active {color: #333333}\n' 102 '<title>RelMon Summary</title>'+\
103 '<link rel="stylesheet" href="%s/style/blueprint/screen.css" type="text/css" media="screen, projection">'%style_location+\
104 '<link rel="stylesheet" href="%s/style/blueprint/print.css" type="text/css" media="print">'%style_location+\
105 '<link rel="stylesheet" href="%s/style/blueprint/plugins/fancy-type/screen.css" type="text/css" media="screen, projection">'%style_location+\
106 '<style type="text/css">'+\
107 '.rotation {display: block;-webkit-transform: rotate(-90deg);-moz-transform: rotate(-90deg); }'+\
111 '%s'%additional_header+\
114 '<div class="container">' 121 return '</div></body></html>' 127 cms_logo_url =
"http://cms-service-reldqm.web.cern.ch/cms-service-reldqm/style/CMS.gif" 129 cms_logo_url =
"cms-service-reldqm/style/CMS.gif" 130 mother_name=basename(directory.mother_dir)
133 mother_file_name=
"../RelMonSummary.html" 135 mother_file_name=
"%s.html" %(
hash_name(mother_name, hashing_flag))
137 mother_file_name=
"RelMonSummary.html" 140 mother_file_name=
"%s.html" %(
hash_name(mother_name, hashing_flag))
143 files = directory.mother_dir.split(
"/")
145 dir_name = files[-2]+files[-1]
148 dir_name = directory.mother_dir
149 mother_file_name=
"%s.html" %(
hash_name(dir_name, hashing_flag))
151 mother_file_name=
"%s.html" %directory.mother_dir.replace(
"/",
"_")
152 mother_file_name=mother_file_name.strip(
"_")
154 link_to_mother=
'<a href="%s">..</a>' %mother_file_name
155 html=
'<div class="span-20">'+\
156 '<h1>%s</h1>'%directory.name+\
158 '<div class="span-1">'+\
159 '<h1>%s</h1>'%link_to_mother+\
161 '<div class="span-3 last">'+\
162 '<img src="%s" class="top right" width="54" hight="54">'%cms_logo_url+\
165 if len(mother_name)>0:
166 html+=
'<h2 class="alt">%s</h2>'% directory.mother_dir+\
172 html=
'<p><span class="caps alt">%s comparisons:</span></p>'%directory.weight
174 if directory.n_successes>0:
175 html+=
'<li><span class="caps">Success: %.1f%% (%s)</span></li>'%(directory.get_success_rate(),directory.n_successes)
176 if directory.n_nulls>0:
177 html+=
'<li><span class="caps">Null: %.1f%% (%s)</span></li>'%(directory.get_null_rate(),directory.n_nulls)
178 if directory.n_fails>0:
179 html+=
'<li><span class="caps">Fail: %.1f%% (%s)</span></li>'%(directory.get_fail_rate(),directory.n_fails)
180 if directory.n_skiped>0:
181 html+=
'<li><span class="caps">Skipped: %.1f%% (%s)</span></li>'%(directory.get_skiped_rate(),directory.n_skiped)
182 if directory.n_missing_objs>0:
183 html+=
'<li><span class="caps">Unpaired: %s</span></li>'%(directory.n_missing_objs)
190 if len(directory.subdirs)==0:
192 html=
'<div class="span-20 colborder">' 193 html+=
'<h2 class="alt">Sub-Directories</h2>' 196 sorted_subdirs= sorted(directory.subdirs, key=
lambda subdir: subdir.name)
197 sorted_subdirs= sorted(sorted_subdirs, key=
lambda subdir: subdir.n_nulls, reverse=
True)
198 sorted_subdirs= sorted(sorted_subdirs, key=
lambda subdir: subdir.n_fails, reverse=
True)
199 for subdir
in sorted_subdirs:
202 link =
"%s.html" %(
hash_name(
join(directory.full_path,name), hashing_flag))
204 link=
"%s_%s_%s.html" %(directory.mother_dir.replace(
"/",
"_"),directory.name.replace(
"/",
"_"),name)
206 html+=
'<div class="span-4 prepend-2 colborder">' 207 html+=
'<h3>%s</h3>'%name
210 html+=
'<div class="span-7">' 214 html+=
'<div class="span-6 last">' 215 html+=
'<a href="%s"><img src="%s" class="top right"></a>'%(link,subdir.get_summary_chart_ajax(150,100))
230 for comparison
in directory.comparisons:
231 test_name=comparison.test_name
232 test_threshold=comparison.test_thr
234 if len(test_name)==0:
235 for subdir
in directory.subdirs:
236 for comparison
in subdir.comparisons:
237 test_name=comparison.test_name
238 test_threshold=comparison.test_thr
240 if len(test_name)!=0:
break 241 if len(test_name)==0:
242 for subsubdir
in subdir.subdirs:
243 for comparison
in subsubdir.comparisons:
244 test_name=comparison.test_name
245 test_threshold=comparison.test_thr
247 if len(test_name)!=0:
break 248 if len(test_name)==0:
249 for subsubsubdir
in subsubdir.subdirs:
250 for comparison
in subsubsubdir.comparisons:
251 test_name=comparison.test_name
252 test_threshold=comparison.test_thr
254 if len(test_name)!=0:
break 259 html=
'<div class="span-6">'+\
262 html+=
'<a href="%s/%s/start?runnr=%s;dataset=/%s/%s/DQMIO;sampletype=offline_data;filter=all;referencepos=on-side;referenceshow=all;referencenorm=True;referenceobj1=other:%s:/%s/%s/DQMIO:;referenceobj2=none;referenceobj3=none;referenceobj4=none;search=;striptype=object;stripruns=;stripaxis=run;stripomit=none;workspace=Everything;size=M;focus=;zoom=no;">To the DQM GUI...</a>' %(server,base_url,meta.run1,meta.sample1,meta.release1,meta.run2,meta.sample2,meta.release2)
265 html+=
'<div class="span-7 colborder">'+\
266 '<img src="%s" class="top right">'%directory.get_summary_chart_ajax(200,200)+\
268 '<div class="span-9 last">' 270 html+=
'<h3>Sample:</h3>'+\
271 '<p class="caps">%s</p>'%meta.sample1+\
272 '<h3>Run1 and Run2:</h3>'+\
273 '<p class="caps">%s - %s</p>'%(meta.run1,meta.run2)
274 html+=
'<h3>Releases:</h3>'+\
275 '<ul><li><p>%s</p></li><li><p>%s</p></li></ul>'%(meta.release1,meta.release2)+\
276 '<h3>Statistical Test (Pvalue threshold):</h3>'+\
277 '<ul><li><p class="caps">%s (%s)</p></li></ul>'%(test_name,test_threshold)+\
285 """Prepare the comparisons between histograms and organise them in the page. 286 Moreover create separate pages with the overlay and the single plots. 292 comparisons= [comp
for comp
in directory.comparisons
if comp.status == cat_states[category]]
293 n_comparisons=len(comparisons)
298 comparisons=sorted(comparisons, key=
lambda comp:comp.rank, reverse=is_reverse)
301 dir_abs_path=
"%s/%s/" %(directory.mother_dir,directory.name)
303 for comparison
in comparisons:
304 plot_name=comparison.img_name
305 if "http://" not in plot_name:
306 plot_name= basename(comparison.img_name)
307 class_type=
"colborder" 308 if counter==3
or tot_counter==n_comparisons:
309 class_type=
" colborder last" 310 comp_abs_path=
"%s/%s" %(dir_abs_path,comparison.name)
313 if directory.do_pngs:
314 png_link=comparison.img_name
315 html_comparisons+=
'<div class="span-6 %s"><p>%s</p>' %(class_type,comparison.name)+\
316 '<p class="alt">%s: %.2E</p>' %(comparison.test_name,comparison.rank)+\
317 '<a href="%s"><img src="%s" width="250" height="200" class="top center %s"></a></div>'%(png_link,png_link,cat_classes[category])
321 directory.meta.sample1,
322 directory.meta.sample2,
323 directory.meta.release1,
324 directory.meta.release2,
326 directory.meta.tier1,
327 directory.meta.tier2,
329 small_fairy=
fairy_url(directory.meta.run1,
331 directory.meta.sample1,
332 directory.meta.sample2,
333 directory.meta.release1,
334 directory.meta.release2,
336 directory.meta.tier1,
337 directory.meta.tier2)
340 directory.meta.sample1,
341 directory.meta.release1,
343 directory.meta.tier1,
346 directory.meta.sample2,
347 directory.meta.release2,
349 directory.meta.tier2,
352 html_comparisons+=
'<div class="span-6 %s"><p>%s</p>' %(class_type,comparison.name)+\
353 '<p class="alt">%s: %.2E</p>' %(comparison.test_name,comparison.rank)+\
354 '<div><a class="black_link" href="%s">%s</a></div>'%(single_fairy1,directory.meta.release1)+\
355 '<div><a href="%s">%s</a></div>'%(single_fairy2,directory.meta.release2)+\
356 '<a href="%s"><img src="%s" class="top center %s"></a></div>'%(big_fairy,small_fairy,cat_classes[category])
359 html_comparisons+=
"<hr>" 364 if len(html_comparisons)!=0:
365 html=
'<div class="span-20"><h2 class="alt">%s Comparisons</h2></div>' %cat_names[category]
366 html+=html_comparisons
375 imgname=
"RankSummary.png" 376 gStyle.SetPadTickY(0)
377 c=TCanvas(
"ranks",
"ranks",500,400)
381 h=directory.rank_histo
382 rank_histof=TH1F(h.GetName(),
"",h.GetNbinsX(),h.GetXaxis().GetXmin(),h.GetXaxis().GetXmax())
383 rank_histof.SetLineWidth(2)
384 for i
in range(0,h.GetNbinsX()+1):
385 rank_histof.SetBinContent(i,h.GetBinContent(i))
386 h.SetTitle(
"Ranks Summary;Rank;Frequency")
389 rank_histof.ComputeIntegral()
390 integral = rank_histof.GetIntegral()
391 rank_histof.SetContent(integral)
393 rightmax = 1.1*rank_histof.GetMaximum()
394 scale = gPad.GetUymax()/rightmax
395 rank_histof.SetLineColor(kRed)
396 rank_histof.Scale(scale)
397 rank_histof.Draw(
"same")
400 axis = TGaxis(gPad.GetUxmax(),gPad.GetUymin(),gPad.GetUxmax(), gPad.GetUymax(),0,rightmax,510,
"+L")
401 axis.SetTitle(
"Cumulative")
402 axis.SetTitleColor(kRed)
403 axis.SetLineColor(kRed)
404 axis.SetLabelColor(kRed)
407 rank_histof.Draw(
"Same");
412 page_html=
'<div class="span-20"><h2 class="alt"><a name="rank_summary">Ranks Summary</a></h2>' 413 page_html+=
'<div class="span-19"><img src="%s"></div>' %imgname
414 page_html+=
'</div> <a href="#top">Top...</a><hr>' 422 """Method to get missing objects from directory: in case histogram/directory was in one ROOT file but not in other 424 page_html =
"Unpaired in %s</br>"%(directory.filename1)
425 for elem
in directory.different_histograms[
'file1']:
426 page_html +=
"name: %s type:%s </br>"%(elem,directory.different_histograms[
'file1'][elem])
428 page_html +=
"Unpaired in %s</br>"%(directory.filename2)
429 for elem
in directory.different_histograms[
'file2']:
430 page_html +=
"name: %s type:%s </br>"%(elem,directory.different_histograms[
'file2'][elem])
435 """Converts a directory tree into html pages, very nice ones. 446 for subdir
in directory.subdirs:
454 for do_cat,cat
in ((directory.n_comp_fails >0,FAIL ),
455 (directory.n_comp_nulls >0,NULL ),
457 (directory.n_comp_successes >0
and directory.draw_success,SUCCESS ),
458 (directory.n_comp_skiped >0,SKIPED)):
462 if (len(directory.different_histograms[
'file1']) >0)
or (len(directory.different_histograms[
'file2']) >0):
473 page_name=directory.name
475 if len(page_name)==0:
476 page_name=
"RelMonSummary" 478 if page_name !=
"RelMonSummary":
481 ofilename =
"%s.html" %(
hash_name(
join(directory.full_path), hashing))
483 ofilename =
"RelMonSummary.html" 485 ofilename=
"%s_%s.html" %(directory.mother_dir.replace(
"/",
"_"),page_name)
486 ofilename=ofilename.strip(
"_")
488 ofile=open(ofilename,
"w")
489 ofile.write(page_html)
496 def build_gauge(total_success_rate,minrate=.80,small=False,escaped=False):
497 total_success_rate_scaled=(total_success_rate-minrate)
498 total_success_rate_scaled_repr=total_success_rate_scaled/(1-minrate)
499 if total_success_rate_scaled_repr<0:
500 total_success_rate_scaled_repr=0
505 gauge_link =
"https://chart.googleapis.com/chart?chs=%s&cht=gom"%size_s
506 gauge_link+=
"&chd=t:%2.1f"%(total_success_rate_scaled_repr*100.)
508 gauge_link+=
"&chxt=x,y&chxl=0:|%2.1f%%|1:|%i%%|%i%%|100%%"%(total_success_rate*100,minrate*100.,(1+minrate)*50)
509 gauge_link+=
"&chma=10,10,10,0" 510 img_tag=
'<img src="%s">'%gauge_link
512 img_tag=html.escape(img_tag)
522 if the_aggr_pairs==[]:
523 for samplename,sampledir
in dir_dict.items():
524 for subsysdirname
in sorted(sampledir.get_subdirs_dict().
keys()):
525 if not subsysdirname
in list_of_names:
526 list_of_names.append(subsysdirname)
527 the_aggr_pairs.append((subsysdirname,[subsysdirname]))
530 for cat_name, subdir_list
in the_aggr_pairs:
532 total_directory_successes=0
537 for dirname, sampledir
in dir_dict.items():
539 for subdirname,subdir
in sampledir.get_subdirs_dict().
items():
540 if subdirname
in subdir_list:
541 nsucc=subdir.n_successes
542 total_successes+=nsucc
547 total_directory_successes+=
float(nsucc)/weight
548 if subdirname
in present_subdirs:
549 this_dir_dict=present_subdirs[subdirname]
550 this_dir_dict[
"nsucc"]+=nsucc
551 this_dir_dict[
"weight"]+=weight
553 present_subdirs[subdirname]={
"nsucc":nsucc,
"weight":weight}
555 for subsubdirname,subsubdir
in subdir.get_subdirs_dict().
items():
556 for pathname
in [name
for name
in subdir_list
if "/" in name]:
557 selected_subdirname,selected_subsubdirname = pathname.split(
"/")
558 if selected_subdirname == subdirname
and selected_subsubdirname==subsubdirname:
560 nsucc=subsubdir.n_successes
561 total_successes+=nsucc
562 weight=subsubdir.weight
565 total_directory_successes+=
float(nsucc)/weight
567 if subsubdirname
in present_subdirs:
568 this_dir_dict=present_subdirs[subsubdirname]
569 this_dir_dict[
"nsucc"]+=nsucc
570 this_dir_dict[
"weight"]+=weight
572 present_subdirs[subsubdirname]={
"nsucc":nsucc,
"weight":weight}
575 print(
"No directory of the category %s is present in the samples: skipping." %cat_name)
578 average_success_rate=total_directory_successes/(total_ndirs)
579 aggr_pairs_info.append((cat_name,present_subdirs,total_weight,average_success_rate))
581 return aggr_pairs_info
593 html=
'<div class="span-20 colborder">' 594 html+=
'<h2 class="alt"><a name="categories">Categories:</a></h2>' 596 for cat_name,present_subdirs,total_weight,average_success_rate
in aggr_pairs_info:
598 html+=
'<div class="span-3 prepend-0 colborder">' 599 html+=
'<h3>%s</h3>'%cat_name
600 html+=
'<div><span class="alt">Avg. Success rate:</span></div>' 601 html+=
'<div><span class="alt">%2.1f%%</span></div>'%(average_success_rate*100)
603 html+=
'<div class="span-9">' 605 html+=
'<div><p><span class="caps alt">DQM Directories (%i comparisons):</span></p></div>' %total_weight
606 html+=
'<div><p><span class="alt">name: succ. rate - rel. weight</span></p></div>' 608 for subdirname
in sorted(present_subdirs.keys()):
609 this_dir_dict=present_subdirs[subdirname]
610 nsucc=this_dir_dict[
"nsucc"]
611 weight=this_dir_dict[
"weight"]
612 html+=
'<li><span class="caps">%s: %2.1f%% - %2.1f%%</span></li>'%(subdirname,100*
float(nsucc)/weight,100*
float(weight)/total_weight)
616 html+=
'<div class="span-6 last">' 621 return html+
'<br><a href="#top">Top...</a> </div><hr>' 628 meta= list(dir_dict.items())[0][1].meta
629 releases=sorted([meta.release1,meta.release2])
630 latest_release=releases[1].
split(
"-")[0]
637 html=
'<div class="span-20 colborder">' 638 html+=
'<h2 class="alt"><a name="twiki_table">Twiki snipppet for release managers</a></h2>' 639 html+=
'<div>| Release | Comparison |' 640 for cat_name,present_subdirs,total_weight,average_success_rate
in aggr_pairs_info:
645 html+=
'<div>| %s | %%ICON{arrowdot}%% | '%latest_release
649 for cat_name,present_subdirs,total_weight,average_success_rate
in aggr_pairs_info:
651 html+=
build_gauge(average_success_rate,small=
True,escaped=
True)
654 html+=
'</div> <a href="#top">Top...</a>' 661 tooltip=
"%s\nS:%2.1f%% N:%2.1f%% F:%2.1f%% Sk:%2.1f%%" %(directory.name,directory.get_success_rate(),directory.get_null_rate(),directory.get_fail_rate(),directory.get_skiped_rate())
671 <script type="text/javascript" src="https://www.google.com/jsapi"></script> 672 <script type="text/javascript"> 673 google.load("visualization", "1", {packages:["corechart"]}); 674 google.setOnLoadCallback(drawChart); 675 function drawChart() { 676 var data = new google.visualization.DataTable(); 677 data.addColumn('string', 'DQM Directory'); 678 data.addColumn('number', 'Success Rate'); 680 script+=
"data.addRows(%i);\n"%len(aggr_pairs_info)
682 for subsystname,present_directories,weight,success_rate
in aggr_pairs_info:
684 script+=
"data.setValue(%i, 0, '%s');\n"%(counter,subsystname)
685 script+=
"data.setValue(%i, 1, %2.2f);\n"%(counter,success_rate)
688 var chart = new google.visualization.BarChart(document.getElementById('%s')); 689 chart.draw(data, {width: 1024, height: %i, title: 'Success Rate', 690 vAxis: {title: '%s', titleTextStyle: {color: 'red'},textStyle: {fontSize: 14}} 694 """%(name,40*counter,title)
700 def make_summary_table(indir,aggregation_rules,aggregation_rules_twiki, hashing_flag, standalone_flag):
701 """Create a table, with as rows the directories and as columns the samples. 702 Each box in the table will contain a pie chart linking to the directory. 708 if os.path.isabs(indir):
709 title = basename(indir)
712 title=title.strip(
".")
713 title=title.strip(
"/")
717 sample_pkls=[name
for name
in listdir(
"./")
if name.endswith(
".pkl")]
722 for sample_pkl
in sample_pkls:
724 dir_unpickler.start()
726 dir_unpicklers.append(dir_unpickler)
729 for dir_unpickler
in dir_unpicklers:
736 for dir_unpickler
in dir_unpicklers:
738 directory=dir_unpickler.directory
741 global_dir.meta=directory.meta
742 dir_dict[dir_unpickler.filename.replace(
".pkl",
"")]=directory
743 global_dir.subdirs.append(directory)
745 global_dir.calcStats()
750 page_html =
get_page_header(standalone=standalone_flag, additional_header=directories_barchart+categories_barchart)
754 rel1,rel2=title.split(
"VS")
756 rel1=global_dir.meta.release1.split(
"-")[0]
757 rel2=global_dir.meta.release2.split(
"-")[0]
758 global_dir.meta.release1=rel1
759 global_dir.meta.release2=rel2
763 for directory
in dir_dict.values():
764 for subdir_name
in directory.get_subdirs_names():
765 all_subdirs.append(subdir_name)
766 all_subdirs=sorted(list(set(all_subdirs)))
771 page_html+=
'<div class="span-20">'+\
772 '<h2><a name="top" href="https://twiki.cern.ch/twiki/bin/view/CMSPublic/RelMon">RelMon</a> Global Report: %s</h2>'%title+\
774 '<div class="span-1">'+\
775 '<h2><a href="%s">main...</a></h2>' %relmon_mainpage+\
778 page_html+=
'<div class="span-24"><p></p></div>\n'*3
784 page_html+=
'<div class="span-24">' 785 page_html+=
'<div class="span-20 colborder"><h2 class="alt">Sections:</h2>'+\
787 '<li><a href="#summary_barchart">Summary Barchart</a></li>'+\
788 '<li><a href="#categories">Categories</a></li>'+\
789 '<li><a href="#detailed_barchart">Detailed Barchart</a></li>'+\
790 '<li><a href="#summary_table">Summary Table</a></li>'+\
791 '<li><a href="#rank_summary">Ranks Summary</a></li>'+\
792 '<li><a href="#twiki_table">Twiki Table</a></li>'+\
798 page_html+=
'<div class="span-24"><h2 class="alt"><a name="summary_barchart">Summary Barchart</a></h2></div>' 799 page_html+=
'<div id="cat_chart"></div> <a href="#top">Top...</a><hr>' 805 page_html+=
'<div class="span-24"><h2 class="alt"><a name="detailed_barchart">Detailed Barchart</a></h2></div>' 806 page_html+=
'<div id="dir_chart"></div> <a href="#top">Top...</a><hr>' 810 page_html+=
'<div class="span-24"><p></p></div>\n' 814 page_html+=
'<div class="span-24"><h2 class="alt"><a name="summary_table">Summary Table</a></h2></div>' 817 page_html+=
'<div class="span-24"><p></p></div>\n' 827 <td><div class="span-1"><p class="rotation" style="alt"><b>Summary</b></p></div></td>""" 829 sorted_samples=sorted(dir_dict.keys())
830 for sample
in sorted_samples:
840 <td><div class="span-1"><p class="rotation" style="">%s</p></div></td>"""%sample_nick
841 page_html+=
" </tr>\n" 847 page_html+=
'<td style="background-color:white;"><div class="span-1">' 849 page_html+=
'<b>Summary</b></div></td>' 850 page_html+=
'<td style="background-color:white;" class = "colborder" ><div class="span-1"><img src="%s" alt="%s"></div></td>'%(global_dir.get_summary_chart_ajax(55,55),
get_pie_tooltip(global_dir))
851 for sample
in sorted_samples:
854 summary_page_name=
"RelMonSummary.html" 856 summary_page_name=
hash_name(col.name, hashing_flag)+
".html" 857 img_link=col.get_summary_chart_ajax(55,55)
858 page_html+=
'<td style="background-color:white;"><div class="span-1">' 859 page_html+=
'<a href="%s/%s"><img src="%s" title="%s"></a></div></td>' %(sample,summary_page_name,img_link,
get_pie_tooltip(col))
863 for subdir_name
in all_subdirs:
866 page_html+=
' <td style="background-color:white;">%s</td>\n' %subdir_name
870 n_samples=len(sorted_samples)
872 for sample
in sorted_samples:
873 subdirs_dict=directory.get_subdirs_dict()
874 directory=dir_dict[sample]
875 dir_is_there=subdir_name
in subdirs_dict
877 row_summary.subdirs.append(subdirs_dict[subdir_name])
880 row_summary.calcStats()
881 img_link=row_summary.get_summary_chart_ajax(55,55)
882 page_html+=
'<td style="background-color:white;"><div class="span-1">' 883 page_html+=
'<img src="%s" title="%s"></div></td>' %(img_link,
get_pie_tooltip(row_summary))
885 for sample
in sorted_samples:
888 directory=dir_dict[sample]
889 subdirs_dict=directory.get_subdirs_dict()
892 if directory.name!=
"":
897 summary_page=
join(sample,
"%s.html"%(
hash_name(directory.name+
"/"+subdir_name,hashing_flag)))
899 summary_page=
join(sample,
"%s.html"%(
hash_name(directory.name+
"_"+subdir_name,hashing_flag)))
903 summary_page=
join(sample,
"%s.html"%(
hash_name(directory.name+subdir_name,hashing_flag)))
904 dir_is_there=subdir_name
in subdirs_dict
906 img_link=
"https://chart.googleapis.com/chart?cht=p3&chco=C0C0C0&chs=50x50&chd=t:1" 910 img_link=subdirs_dict[subdir_name].get_summary_chart_ajax(50,50)
913 page_html+=
'<td style="background-color:white;"><div class="span-1">' 915 page_html+=
'<a href="%s">'%(summary_page)
916 page_html+=
'<img src="%s" title="%s" height=50 width=50>' %(img_link,img_tooltip)
919 page_html+=
'</div></td>' 921 page_html+=
" </tr>\n" 925 page_html+=
'</table> <a href="#top">Top...</a><hr>' 938 if (3,0,0) <= sys.version_info:
939 return hashlib.md5(file_name.encode(
'utf-8')).hexdigest()[:10]
940 return hashlib.md5(file_name).hexdigest()[:10]
def build_gauge(total_success_rate, minrate=.80, small=False, escaped=False)
def hash_name(file_name, flag)
def get_comparisons(category, directory)
def get_subdirs_section(directory, hashing_flag)
def get_pie_tooltip(directory)
def build_obj(run, sample, version, plot_path, tier)
def get_aggr_pairs_info(dir_dict, the_aggr_pairs=[])
def make_summary_table(indir, aggregation_rules, aggregation_rules_twiki, hashing_flag, standalone_flag)
def plot_size(h=250, w=200)
def get_page_header(directory=None, standalone=False, additional_header="")
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def get_title_section(directory, hashing_flag, standalone, depth=2)
def get_dir_stats(directory)
def make_barchart_summary(dir_dict, name="the_chart", title="DQM directory", the_aggr_pairs=[])
def get_summary_section(directory, matrix_page=True)
def split(sequence, size)
def directory2html(directory, hashing, standalone, depth=0)
def make_twiki_table(dir_dict, aggregation_rules)
static std::string join(char **cmd)
def make_categories_summary(dir_dict, aggregation_rules)
def fairy_url_single(run, sample, version, plot_path, tier, draw_opts="", h=250, w=200)
def fairy_url(run1, run2, sample1, sample2, version1, version2, plot_path, tier1, tier2, draw_opts="", h=250, w=200)
def build_obj_addr(run, sample, version, plot_path, tier)
def get_missing_objs_section(directory)
def get_rank_section(directory)