From 0559ef258e543a8caab273a24e8334fafab4a4aa Mon Sep 17 00:00:00 2001
From: unknown <david.hoksza@gmail.com>
Date: Mon, 11 Nov 2019 10:28:44 +0100
Subject: [PATCH] fix problem when instead of changing direction the direction
 was subtracted

---
 gui_config.ini          | 2 +-
 talent/graphics.py      | 2 --
 talent/layout.py        | 4 +---
 talent/utils/convert.py | 3 ++-
 4 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/gui_config.ini b/gui_config.ini
index 378518e..da13944 100644
--- a/gui_config.ini
+++ b/gui_config.ini
@@ -1,5 +1,5 @@
 [input]
-openTgtFileDir=C:/projects/git/talent/tmp/pd_test1.sbml
+openTgtFileDir=C:/projects/git/talent/tmp/journal.pcbi.1002577.s002.XML
 openTmpFileDir=C:/projects/git/talent/tmp/pd_test2.sbml
 openOutputPathButton=C:/projects/git/talent/out
 openOutputPath=C:/projects/git/talent/out
diff --git a/talent/graphics.py b/talent/graphics.py
index 18d6490..4d676ee 100644
--- a/talent/graphics.py
+++ b/talent/graphics.py
@@ -256,8 +256,6 @@ class Line:
                 raise TypeError("Arguments need to be of type List or np.array or tuple")
 
             if not allow_zero_length:
-                if not(p1[0] != p2[0] or p1[1] != p2[1]):
-                    asdf=1
                 assert p1[0] != p2[0] or p1[1] != p2[1]
 
         self._p = [p1, p2]
diff --git a/talent/layout.py b/talent/layout.py
index b8e3885..14644d4 100644
--- a/talent/layout.py
+++ b/talent/layout.py
@@ -1117,8 +1117,6 @@ def fix_ods_intersections(g: nx.MultiGraph, r_id: str):
 
         i = 0
         for s_id in to_reposition_s_ids:
-            if i >= len(aux_new_poss):
-                asdf=1
             set_node_pos(g.nodes[s_id], np.array(aux_new_poss[i]))
             i += 1
 
@@ -1858,7 +1856,7 @@ def l_not_mapped_connecting_species(g_res, tgt_orig, tmp_orig, to_layout, nodes_
                     # Majority of the new connecting species are in the reactant role and since the dir vector
                     # points toward product roles we need to switch the direction so that first will be laid out reactants
                     # (if there is space)
-                    dir -= dir
+                    dir = -dir
 
                 # Sort the species from reactants to products since the positions will be assigned in this order
                 # and they will go from "left" to "right" with respect to the center and direction vector
diff --git a/talent/utils/convert.py b/talent/utils/convert.py
index 48eded7..05a3ba7 100644
--- a/talent/utils/convert.py
+++ b/talent/utils/convert.py
@@ -49,7 +49,8 @@ def minerva_convert(in_string: str, in_format: str, out_format: str, minerva_ins
 
     # response = requests.post(api_address, cookies=dict(MINERVA_AUTH_TOKEN=token), data=in_string)
     headers = {'Content-Type': 'text/xml; charset=utf-8', }
-    response = requests.post(api_address, data=in_string.encode('utf-8'), headers=headers)
+    response = requests.post(api_address, data=in_string, headers=headers)
+    # response = requests.post(api_address, data=in_string.encode('utf-8'), headers=headers)
     result = response.content if out_format == "pdf" or out_format == "png" else response.text
 
     return result
-- 
GitLab