From a631e6b6177bb724df5822ace79493c058a7db9c Mon Sep 17 00:00:00 2001
From: Oscar Gustafsson <oscar.gustafsson@gmail.com>
Date: Fri, 20 Jan 2023 09:46:50 +0100
Subject: [PATCH] execution_time can return None

---
 b_asic/operation.py                             | 4 +---
 b_asic/scheduler_gui/graphics_component_item.py | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/b_asic/operation.py b/b_asic/operation.py
index 41309c83..4d1ee7e5 100644
--- a/b_asic/operation.py
+++ b/b_asic/operation.py
@@ -890,9 +890,7 @@ class AbstractOperation(Operation, AbstractGraphComponent):
                 )
 
     @property
-    def execution_time(self) -> int:
-        if self._execution_time is None:
-            raise ValueError("No execution time specified.")
+    def execution_time(self) -> Optional[int]:
         return self._execution_time
 
     @execution_time.setter
diff --git a/b_asic/scheduler_gui/graphics_component_item.py b/b_asic/scheduler_gui/graphics_component_item.py
index d69df550..ffc9b1a6 100644
--- a/b_asic/scheduler_gui/graphics_component_item.py
+++ b/b_asic/scheduler_gui/graphics_component_item.py
@@ -229,7 +229,7 @@ class GraphicsComponentItem(QGraphicsItemGroup):
         self._label_item.setPos(self._component_item.pos() + center)
 
         ## execution time
-        if self._operation.execution_time:
+        if self._operation.execution_time is not None:
             self._execution_time_item = QGraphicsRectItem(
                 0, 0, self._operation.execution_time, self._height
             )
-- 
GitLab