Skip to content

Commit

Permalink
delayed import
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Feb 3, 2025
1 parent a7a4a92 commit 6979113
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from spinn_utilities.log import FormatAdapter

import spynnaker.pyNN.external_devices as external_devices
from spynnaker.pyNN.__init__ import end, run
from spynnaker.pyNN.external_devices_models.push_bot.parameters import (
PushBotRetinaResolution)
from spynnaker.pyNN.connections import SpynnakerLiveSpikesConnection
Expand All @@ -45,7 +44,7 @@ class PushBotRetinaViewer():
"__running", "__conn")

def __init__(self, retina_resolution: PushBotRetinaResolution,
label: str, sim: None):
label: str, sim: None = None):
if sim is not None:
_logger.warning("PushBotRetinaViewer: sim=None is deprecated")
pyplot.ion()
Expand Down Expand Up @@ -88,6 +87,9 @@ def __recv(self, label: str, time: int, spikes: List[int]) -> None:
self.__image_lock.release()

def __run_sim_forever(self) -> None:
# UGLY but needed to avoid circular import
# pylint: disable=import-outside-toplevel
from pyNN.spiNNaker import end, run
try:
external_devices.run_forever()
self.__running = False
Expand All @@ -98,6 +100,9 @@ def __run_sim_forever(self) -> None:
_logger.exception("unexpected exception in simulation thread")

def __run_sim(self, run_time: float) -> None:
# UGLY but needed to avoid circular import
# pylint: disable=import-outside-toplevel
from pyNN.spiNNaker import end, run
try:
run(run_time)
self.__running = False
Expand Down

0 comments on commit 6979113

Please sign in to comment.