From 130398f2787c1652999d0903bf36918249a509b3 Mon Sep 17 00:00:00 2001 From: Brett Dutro Date: Thu, 2 May 2024 15:43:37 -0500 Subject: [PATCH 1/2] Fix NameError: name 'ScheduleLineElement' is not defined error in Argos --- helios/pipeViewer/pipe_view/model/element_value.py | 4 +--- helios/pipeViewer/pipe_view/model/schedule_element.py | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/helios/pipeViewer/pipe_view/model/element_value.py b/helios/pipeViewer/pipe_view/model/element_value.py index 7560011cc1..2dd19a94ce 100644 --- a/helios/pipeViewer/pipe_view/model/element_value.py +++ b/helios/pipeViewer/pipe_view/model/element_value.py @@ -8,9 +8,7 @@ from . import content_options as content from . import highlighting_utils from .element import Element, FakeElement, PropertyValue - -if TYPE_CHECKING: - from .schedule_element import ScheduleLineElement +from .schedule_element import ScheduleLineElement TimedVal = Tuple[Optional[Union[int, str]], Tuple[int, int]] diff --git a/helios/pipeViewer/pipe_view/model/schedule_element.py b/helios/pipeViewer/pipe_view/model/schedule_element.py index f71b218775..469dc870fd 100644 --- a/helios/pipeViewer/pipe_view/model/schedule_element.py +++ b/helios/pipeViewer/pipe_view/model/schedule_element.py @@ -16,7 +16,9 @@ PropertyValue, ValidatedPropertyDict) from . import element_propsvalid as valid -from .element_value import Element_Value, FakeElementValue + +if TYPE_CHECKING: + from .element_value import Element_Value, FakeElementValue if TYPE_CHECKING: from .clock_manager import ClockManager @@ -387,6 +389,8 @@ def GetQueryFrame(self, period: int) -> Tuple[int, int]: def DetectCollision(self, pt: Union[Tuple[int, int], wx.Point], pair: Element_Value) -> FakeElementValue: + from .element_value import FakeElementValue + mx, my = pt period = pair.GetClockPeriod() From 68f1029c159913b822db78d122be4c8c4f2a43f5 Mon Sep 17 00:00:00 2001 From: Brett Dutro Date: Thu, 2 May 2024 15:49:12 -0500 Subject: [PATCH 2/2] Remove unused import to fix Python linter errors --- helios/pipeViewer/pipe_view/model/element_value.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helios/pipeViewer/pipe_view/model/element_value.py b/helios/pipeViewer/pipe_view/model/element_value.py index 2dd19a94ce..4bf78fef88 100644 --- a/helios/pipeViewer/pipe_view/model/element_value.py +++ b/helios/pipeViewer/pipe_view/model/element_value.py @@ -4,7 +4,7 @@ # [Element, val]. from __future__ import annotations from bisect import bisect, bisect_left -from typing import Any, Dict, List, Optional, Tuple, Union, TYPE_CHECKING +from typing import Any, Dict, List, Optional, Tuple, Union from . import content_options as content from . import highlighting_utils from .element import Element, FakeElement, PropertyValue