Skip to content

Commit

Permalink
move import of ray into __call__ just in case.
Browse files Browse the repository at this point in the history
  • Loading branch information
dboulware committed Mar 14, 2024
1 parent aab77b9 commit 57452a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scos_actions/actions/acquire_sea_data_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import numpy as np
import psutil
import ray
from environs import Env
from its_preselector import __version__ as PRESELECTOR_API_VERSION
from scipy.signal import sos2tf, sosfilt
Expand Down Expand Up @@ -506,6 +505,8 @@ def __call__(self, sensor: Sensor, schedule_entry: dict, task_id: int):
action_start_tic = perf_counter()
# Ray should have already been initialized within scos-sensor,
# but check and initialize just in case.
import ray

if not ray.is_initialized():
logger.info("Initializing ray.")
logger.info("Set RAY_INIT=true to avoid initializing within " + __name__)
Expand Down

0 comments on commit 57452a6

Please sign in to comment.