From 7b6a750aff2de70766537c79c784a659b51af747 Mon Sep 17 00:00:00 2001
From: lucas_miranda <lucasmiranda42@gmail.com>
Date: Mon, 28 Sep 2020 20:53:14 +0200
Subject: [PATCH] Refactored pose_utils.py

---
 deepof/pose_utils.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/deepof/pose_utils.py b/deepof/pose_utils.py
index df69b47c..f49c3969 100644
--- a/deepof/pose_utils.py
+++ b/deepof/pose_utils.py
@@ -313,10 +313,14 @@ def single_behaviour_analysis(
         stat_dict = {}
         for i in combinations(treatment_dict.keys(), 2):
             # Solves issue with automatically generated examples
-            if (
-                beh_dict[i[0]] == beh_dict[i[1]]
-                or np.var(beh_dict[i[0]]) == 0
-                or np.var(beh_dict[i[1]]) == 0
+            if np.any(
+                np.array(
+                    [
+                        beh_dict[i[0]] == beh_dict[i[1]],
+                        np.var(beh_dict[i[0]]) == 0,
+                        np.var(beh_dict[i[1]]) == 0,
+                    ]
+                )
             ):
                 stat_dict[i] = "Identical sources. Couldn't run"
             else:
-- 
GitLab