From 0747f279c85c8c43b934e7a744656bed9cd79e52 Mon Sep 17 00:00:00 2001 From: Sergey Vartanov Date: Fri, 4 Jun 2021 04:02:28 +0300 Subject: [PATCH] Fix main direction computing. --- roentgen/direction.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roentgen/direction.py b/roentgen/direction.py index 1989ad9..cefc260 100644 --- a/roentgen/direction.py +++ b/roentgen/direction.py @@ -114,11 +114,12 @@ class Sector: None otherwise. """ if self.main_direction is not None: - if self.main_direction[0] > 0: + if np.allclose(self.main_direction[0], 0): + return None + elif self.main_direction[0] > 0: return True - elif self.main_direction[0] < 0: + else: return False - return None def __str__(self) -> str: return f"{self.start}-{self.end}"