From 38ab2aa5732697ae8a9f28191e694e26034eee59 Mon Sep 17 00:00:00 2001
From: Konstantin Baierer <unixprog@gmail.com>
Date: Tue, 2 Mar 2021 13:36:25 +0100
Subject: [PATCH] eliminate tartib var

---
 qurator/eynollah/eynollah.py | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/qurator/eynollah/eynollah.py b/qurator/eynollah/eynollah.py
index 75971ec..46739bd 100644
--- a/qurator/eynollah/eynollah.py
+++ b/qurator/eynollah/eynollah.py
@@ -1173,18 +1173,16 @@ class Eynollah:
 
                 for zahler, _ in enumerate(args_contours_box):
                     arg_order_v = indexes_sorted_main[zahler]
-                    tartib = np.where(indexes_sorted == arg_order_v)[0][0]
-                    order_by_con_main[args_contours_box[indexes_by_type_main[zahler]]] = tartib + ref_point
+                    order_by_con_main[args_contours_box[indexes_by_type_main[zahler]]] = np.where(indexes_sorted == arg_order_v)[0][0] + ref_point
 
                 for zahler, _ in enumerate(args_contours_box_h):
                     arg_order_v = indexes_sorted_head[zahler]
-                    tartib = np.where(indexes_sorted == arg_order_v)[0][0]
-                    order_by_con_head[args_contours_box_h[indexes_by_type_head[zahler]]] = tartib + ref_point
+                    order_by_con_head[args_contours_box_h[indexes_by_type_head[zahler]]] = np.where(indexes_sorted == arg_order_v)[0][0] + ref_point
 
                 for jji in range(len(id_of_texts)):
                     order_of_texts_tot.append(order_of_texts[jji] + ref_point)
                     id_of_texts_tot.append(id_of_texts[jji])
-                ref_point = ref_point + len(id_of_texts)
+                ref_point += len(id_of_texts)
 
             order_of_texts_tot = []
             for tj1 in range(len(contours_only_text_parent)):
@@ -1247,18 +1245,16 @@ class Eynollah:
 
                 for zahler, _ in enumerate(args_contours_box):
                     arg_order_v = indexes_sorted_main[zahler]
-                    tartib = np.where(indexes_sorted == arg_order_v)[0][0]
-                    order_by_con_main[args_contours_box[indexes_by_type_main[zahler]]] = tartib + ref_point
+                    order_by_con_main[args_contours_box[indexes_by_type_main[zahler]]] = np.where(indexes_sorted == arg_order_v)[0][0] + ref_point
 
                 for zahler, _ in enumerate(args_contours_box_h):
                     arg_order_v = indexes_sorted_head[zahler]
-                    tartib = np.where(indexes_sorted == arg_order_v)[0][0]
-                    order_by_con_head[args_contours_box_h[indexes_by_type_head[zahler]]] = tartib + ref_point
+                    order_by_con_head[args_contours_box_h[indexes_by_type_head[zahler]]] = np.where(indexes_sorted == arg_order_v)[0][0] + ref_point
 
                 for jji, _ in enumerate(id_of_texts):
                     order_of_texts_tot.append(order_of_texts[jji] + ref_point)
                     id_of_texts_tot.append(id_of_texts[jji])
-                ref_point = ref_point + len(id_of_texts)
+                ref_point += len(id_of_texts)
 
             order_of_texts_tot = []
             for tj1 in range(len(contours_only_text_parent)):
@@ -1305,13 +1301,12 @@ class Eynollah:
 
                 for zahler, _ in enumerate(args_contours_box):
                     arg_order_v = indexes_sorted_main[zahler]
-                    tartib = np.where(indexes_sorted == arg_order_v)[0][0]
-                    order_by_con_main[args_contours_box[indexes_by_type_main[zahler]]] = tartib + ref_point
+                    order_by_con_main[args_contours_box[indexes_by_type_main[zahler]]] = np.where(indexes_sorted == arg_order_v)[0][0] + ref_point
 
                 for jji, _ in range(len(id_of_texts)):
                     order_of_texts_tot.append(order_of_texts[jji] + ref_point)
                     id_of_texts_tot.append(id_of_texts[jji])
-                ref_point = ref_point + len(id_of_texts)
+                ref_point += len(id_of_texts)
 
             order_of_texts_tot = []
             for tj1 in range(len(contours_only_text_parent)):
@@ -1353,13 +1348,12 @@ class Eynollah:
 
                 for zahler, _ in enumerate(args_contours_box):
                     arg_order_v = indexes_sorted_main[zahler]
-                    tartib = np.where(indexes_sorted == arg_order_v)[0][0]
-                    order_by_con_main[args_contours_box[indexes_by_type_main[zahler]]] = tartib + ref_point
+                    order_by_con_main[args_contours_box[indexes_by_type_main[zahler]]] = np.where(indexes_sorted == arg_order_v)[0][0] + ref_point
 
                 for jji, _ in enumerate(id_of_texts):
                     order_of_texts_tot.append(order_of_texts[jji] + ref_point)
                     id_of_texts_tot.append(id_of_texts[jji])
-                ref_point = ref_point + len(id_of_texts)
+                ref_point += len(id_of_texts)
 
             order_of_texts_tot = []
             for tj1 in range(len(contours_only_text_parent)):