Skip to content

Commit

Permalink
fix: 🐛 Add sys.executable as the Python interpreter in worker scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhoadesScholar committed Mar 9, 2024
1 parent 0db2617 commit 66544b8
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
4 changes: 3 additions & 1 deletion dacapo/blockwise/argmax_worker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pathlib import Path
import sys
from dacapo.experiments.datasplits.datasets.arrays.zarr_array import ZarrArray
from dacapo.store.array_store import LocalArrayIdentifier
from dacapo.compute_context import create_compute_context
Expand Down Expand Up @@ -87,7 +88,8 @@ def spawn_worker(

# Make the command for the worker to run
command = [
"python",
# "python",
sys.executable,
path,
"start-worker",
"--input_container",
Expand Down
4 changes: 3 additions & 1 deletion dacapo/blockwise/predict_worker.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from pathlib import Path

import torch
Expand Down Expand Up @@ -208,7 +209,8 @@ def spawn_worker(

# Make the command for the worker to run
command = [
"python",
# "python",
sys.executable,
path,
"start-worker",
"--run-name",
Expand Down
4 changes: 3 additions & 1 deletion dacapo/blockwise/relabel_worker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from glob import glob
import os
import sys
import daisy
from dacapo.compute_context import create_compute_context
from dacapo.store.array_store import LocalArrayIdentifier
Expand Down Expand Up @@ -101,7 +102,8 @@ def spawn_worker(

# Make the command for the worker to run
command = [
"python",
# "python",
sys.executable,
path,
"start-worker",
"--output_container",
Expand Down
4 changes: 3 additions & 1 deletion dacapo/blockwise/segment_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os
from pathlib import Path
import sys
import click
import daisy
from funlib.persistence import Array
Expand Down Expand Up @@ -191,7 +192,8 @@ def spawn_worker(

# Make the command for the worker to run
command = [
"python",
# "python",
sys.executable,
path,
"start-worker",
"--input_container",
Expand Down
4 changes: 3 additions & 1 deletion dacapo/blockwise/threshold_worker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pathlib import Path
import sys
from dacapo.experiments.datasplits.datasets.arrays.zarr_array import ZarrArray
from dacapo.store.array_store import LocalArrayIdentifier
from dacapo.compute_context import create_compute_context
Expand Down Expand Up @@ -89,7 +90,8 @@ def spawn_worker(

# Make the command for the worker to run
command = [
"python",
# "python",
sys.executable,
path,
"start-worker",
"--input_container",
Expand Down
5 changes: 4 additions & 1 deletion tests/fixtures/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ def mongo_db_available():
def options(request, tmp_path):
# read the options from the users config file locally
options = Options.instance(
type=request.param, runs_base_dir="tests", mongo_db_name="dacapo_tests"
type=request.param,
runs_base_dir="tests",
mongo_db_name="dacapo_tests",
compute_context={"type": "LocalTorch", "config": {}},
)

# change to a temporary directory for this test only
Expand Down

0 comments on commit 66544b8

Please sign in to comment.