]> git.donarmstrong.com Git - lilypond.git/blobdiff - buildscripts/output-distance.py
Merge branch 'master' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / buildscripts / output-distance.py
index 374f7695dbf3e07e9182d8b516c00ea07d2595e8..e56b1e477de1e044df67092e2269aa19428aabd5 100644 (file)
@@ -383,8 +383,6 @@ class FileLink:
         return self.file_names[oldnew]
     
     def html_record_string (self, dest_dir):
-        self.link_files_for_html (dest_dir)
-        
         dist = self.distance()
         
         details = self.get_distance_details ()
@@ -392,7 +390,7 @@ class FileLink:
             details_base = os.path.splitext (self.file_names[1])[0]
             details_base += '.details.html'
             fn = dest_dir + '/'  + details_base
-            open (fn, 'w').write (details)
+            open_write_file (fn).write (details)
 
             details = '<br>(<a href="%(details_base)s">details</a>)' % locals ()
 
@@ -488,7 +486,7 @@ class ProfileFileLink (FileCompareLink):
                 str += '%-8s: %d\n' %  (k, int (self.results[oldnew][k]))
             else:
                 str += '%-8s: %8d (%5.3f)\n' % (k, int (self.results[oldnew][k]),
-                                         self.get_ratio (k))
+                                                self.get_ratio (k))
 
         return '<pre>%s</pre>' % str
             
@@ -510,12 +508,13 @@ class ProfileFileLink (FileCompareLink):
                     note_info, self.contents[oldnew])
 
         dist = 0.0
-        factor = {'time': 1.0 ,
-                  'cells': 10.0,
+        factor = {'time': 2.0 ,
+                  'cells': 5.0,
                   }
         
         for k in ('time', 'cells'):
-            dist += math.tan (self.get_ratio (k) /(0.5* math.pi)) * factor[k]  - 1
+            real_val = math.tan (self.get_ratio (k) * 0.5* math.pi)
+            dist += math.exp (math.fabs (real_val) * factor[k])  - 1
 
         dist = min (dist, 100)
         return dist
@@ -931,7 +930,12 @@ class ComparisonData:
 
         dest_file = dest_dir + '/index.html'
         open_write_file (dest_file).write (html)
+
+
+        for link in changed:
+            link.link_files_for_html (dest_dir)
         
+
     def print_results (self, threshold):
         self.write_text_result_page ('', threshold)