parameters: (category,directory)
return_statement: return ""
docstring: Prepare the comparisons between histograms and organise them in the page.
    Moreover create separate pages with the overlay and the single plots.
docstring_summary: Prepare the comparisons between histograms and organise them in the page.
    Moreover create separate pages with the overlay and the single plots.
docstring_tokens: Prepare the comparisons between histograms and organise them in the page . Moreover create separate pages with the overlay and the single plots .
function: def get_comparisons(category,directory):
    """Prepare the comparisons between histograms and organise them in the page.
    Moreover create separate pages with the overlay and the single plots.
    """
    counter=1
    tot_counter=1
    
    # get the right ones
    comparisons= [comp for comp in directory.comparisons if comp.status == cat_states[category]] 
    n_comparisons=len(comparisons)    
  
    is_reverse=True
    if category == FAIL:
      is_reverse=False
    comparisons=sorted(comparisons, key=lambda comp:comp.rank, reverse=is_reverse)
  
    
    dir_abs_path="%s/%s/" %(directory.mother_dir,directory.name)
    html_comparisons=""
    for comparison in comparisons:
      plot_name=comparison.img_name
      if "http://" not in plot_name:
        plot_name= basename(comparison.img_name)
      class_type="colborder"    
      if counter==3 or tot_counter==n_comparisons:
        class_type=" colborder last"
      comp_abs_path="%s/%s" %(dir_abs_path,comparison.name)
  
  
      if directory.do_pngs:
        png_link=comparison.img_name
        html_comparisons+='<div class="span-6 %s"><p>%s</p>' %(class_type,comparison.name)+\
                        '<p class="alt">%s: %.2E</p>' %(comparison.test_name,comparison.rank)+\
                        '<a href="%s"><img src="%s" width="250" height="200" class="top center %s"></a></div>'%(png_link,png_link,cat_classes[category])
      else:
        big_fairy=fairy_url(directory.meta.run1,
                          directory.meta.run2,
                          directory.meta.sample1,
                          directory.meta.sample2,
                          directory.meta.release1,
                          directory.meta.release2,
                          comp_abs_path,
                          directory.meta.tier1,
                          directory.meta.tier2,
                          "",600,600)
        small_fairy=fairy_url(directory.meta.run1,
                          directory.meta.run2,
                          directory.meta.sample1,
                          directory.meta.sample2,
                          directory.meta.release1,
                          directory.meta.release2,
                          comp_abs_path,
                          directory.meta.tier1,
                          directory.meta.tier2)    
  
        single_fairy1=fairy_url_single(directory.meta.run1,
                                     directory.meta.sample1,
                                     directory.meta.release1,
                                     comp_abs_path,
                                     directory.meta.tier1,
                                     "",500,500)
        single_fairy2=fairy_url_single(directory.meta.run2,
                                     directory.meta.sample2,
                                     directory.meta.release2,
                                     comp_abs_path,
                                     directory.meta.tier2,
                                     "",500,500)
  
        html_comparisons+='<div class="span-6 %s"><p>%s</p>' %(class_type,comparison.name)+\
                        '<p class="alt">%s: %.2E</p>' %(comparison.test_name,comparison.rank)+\
                        '<div><a class="black_link" href="%s">%s</a></div>'%(single_fairy1,directory.meta.release1)+\
                        '<div><a href="%s">%s</a></div>'%(single_fairy2,directory.meta.release2)+\
                        '<a href="%s"><img src="%s" class="top center %s"></a></div>'%(big_fairy,small_fairy,cat_classes[category])
  
      if counter==3:                    
        html_comparisons+="<hr>"
        counter=0
      counter+=1
      tot_counter+=1
  
    if len(html_comparisons)!=0:
      html='<div class="span-20"><h2 class="alt">%s Comparisons</h2></div>' %cat_names[category]
      html+=html_comparisons
      html+='<hr>'
      return html
    return ""
function_tokens: def get_comparisons ( category , directory ) : counter = 1 tot_counter = 1 # get the right ones comparisons = [ comp for comp in directory . comparisons if comp . status == cat_states [ category ] ] n_comparisons = len ( comparisons ) is_reverse = True if category == FAIL : is_reverse = False comparisons = sorted ( comparisons , key = lambda comp : comp . rank , reverse = is_reverse ) dir_abs_path = "%s/%s/" % ( directory . mother_dir , directory . name ) html_comparisons = "" for comparison in comparisons : plot_name = comparison . img_name if "http://" not in plot_name : plot_name = basename ( comparison . img_name ) class_type = "colborder" if counter == 3 or tot_counter == n_comparisons : class_type = " colborder last" comp_abs_path = "%s/%s" % ( dir_abs_path , comparison . name ) if directory . do_pngs : png_link = comparison . img_name html_comparisons += '<div class="span-6 %s"><p>%s</p>' % ( class_type , comparison . name ) + '<p class="alt">%s: %.2E</p>' % ( comparison . test_name , comparison . rank ) + '<a href="%s"><img src="%s" width="250" height="200" class="top center %s"></a></div>' % ( png_link , png_link , cat_classes [ category ] ) else : big_fairy = fairy_url ( directory . meta . run1 , directory . meta . run2 , directory . meta . sample1 , directory . meta . sample2 , directory . meta . release1 , directory . meta . release2 , comp_abs_path , directory . meta . tier1 , directory . meta . tier2 , "" , 600 , 600 ) small_fairy = fairy_url ( directory . meta . run1 , directory . meta . run2 , directory . meta . sample1 , directory . meta . sample2 , directory . meta . release1 , directory . meta . release2 , comp_abs_path , directory . meta . tier1 , directory . meta . tier2 ) single_fairy1 = fairy_url_single ( directory . meta . run1 , directory . meta . sample1 , directory . meta . release1 , comp_abs_path , directory . meta . tier1 , "" , 500 , 500 ) single_fairy2 = fairy_url_single ( directory . meta . run2 , directory . meta . sample2 , directory . meta . release2 , comp_abs_path , directory . meta . tier2 , "" , 500 , 500 ) html_comparisons += '<div class="span-6 %s"><p>%s</p>' % ( class_type , comparison . name ) + '<p class="alt">%s: %.2E</p>' % ( comparison . test_name , comparison . rank ) + '<div><a class="black_link" href="%s">%s</a></div>' % ( single_fairy1 , directory . meta . release1 ) + '<div><a href="%s">%s</a></div>' % ( single_fairy2 , directory . meta . release2 ) + '<a href="%s"><img src="%s" class="top center %s"></a></div>' % ( big_fairy , small_fairy , cat_classes [ category ] ) if counter == 3 : html_comparisons += "<hr>" counter = 0 counter += 1 tot_counter += 1 if len ( html_comparisons ) != 0 : html = '<div class="span-20"><h2 class="alt">%s Comparisons</h2></div>' % cat_names [ category ] html += html_comparisons html += '<hr>' return html return ""