[aligner] the neighbouring function in ``alignall`` is optional. python-nazca-0.1.0
authorSimon Chabot <simon.chabot@logilab.fr>
Thu, 29 Nov 2012 15:11:54 +0100
changeset 173 4e2afdca3f0c
parent 172 0c1c26ddc444
child 174 90c4c74d5d8a
[aligner] the neighbouring function in ``alignall`` is optional. In order to provide the more generic function, the ``mode`` argument in the ``alignall`` function is optional. So, it's possible to use this function with ou without neighbouring finding, which wasn't before.
aligner.py
--- a/aligner.py	Thu Nov 29 14:09:00 2012 +0100
+++ b/aligner.py	Thu Nov 29 15:11:54 2012 +0100
@@ -267,11 +267,15 @@
              indexes=(1,1), mode='kdtree', neighbours_threshold=0.1,
              n_clusters=None, kwordsgram=1, siglen=200, uniq=False):
 
-    matched = conquer_and_divide_alignment(alignset, targetset,
-                                           threshold, treatments, indexes, mode,
-                                           neighbours_threshold,
-                                           n_clusters, kwordsgram,
-                                           siglen, get_global_mat=False)
+    if not mode:
+        _, matched = align(alignset, targetset, threshold, treatments,
+                           resultfile=None, _applyNormalization=True)
+    else:
+        matched = conquer_and_divide_alignment(alignset, targetset, threshold,
+                                               treatments, indexes, mode,
+                                               neighbours_threshold, n_clusters,
+                                               kwordsgram, siglen,
+                                               get_global_mat=False)
 
     if not uniq:
         for alignid in matched: