Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NameError: name 'ScheduleLineElement' is not defined error in Argos #500

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions helios/pipeViewer/pipe_view/model/element_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
# [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

if TYPE_CHECKING:
from .schedule_element import ScheduleLineElement
from .schedule_element import ScheduleLineElement


TimedVal = Tuple[Optional[Union[int, str]], Tuple[int, int]]
Expand Down
6 changes: 5 additions & 1 deletion helios/pipeViewer/pipe_view/model/schedule_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Comment on lines +392 to +393
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FakeElementValue is only actually used in this function. By importing it here, we avoid a circular import dependency with element_value.py.

mx, my = pt

period = pair.GetClockPeriod()
Expand Down
Loading