From 3703c4ac8f48110667c27c245ffbba00e1e1807c Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Sat, 16 Dec 2023 13:49:16 +0000 Subject: [PATCH] rename cellfinder workflow to avoid circular import issue --- benchmarks/cellfinder_core.py | 8 +++----- .../{cellfinder_core.py => cellfinder.py} | 0 pyproject.toml | 2 +- tests/cellfinder_core/conftest.py | 2 +- .../test_integration/test_cellfinder.py | 4 ++-- tests/cellfinder_core/test_unit/test_cellfinder.py | 10 +++------- 6 files changed, 10 insertions(+), 16 deletions(-) rename brainglobe_workflows/cellfinder_core/{cellfinder_core.py => cellfinder.py} (100%) diff --git a/benchmarks/cellfinder_core.py b/benchmarks/cellfinder_core.py index 8cc7186a..717cc085 100644 --- a/benchmarks/cellfinder_core.py +++ b/benchmarks/cellfinder_core.py @@ -7,16 +7,14 @@ from cellfinder_core.main import main as cellfinder_run from cellfinder_core.tools.IO import read_with_dask -from brainglobe_workflows.cellfinder_core.cellfinder_core import ( +from brainglobe_workflows.cellfinder_core.cellfinder import ( CellfinderConfig, run_workflow_from_cellfinder_run, ) -from brainglobe_workflows.cellfinder_core.cellfinder_core import ( +from brainglobe_workflows.cellfinder_core.cellfinder import ( setup as setup_cellfinder_workflow, ) -from brainglobe_workflows.utils import ( - DEFAULT_JSON_CONFIG_PATH_CELLFINDER, -) +from brainglobe_workflows.utils import DEFAULT_JSON_CONFIG_PATH_CELLFINDER class TimeBenchmarkPrepGIN: diff --git a/brainglobe_workflows/cellfinder_core/cellfinder_core.py b/brainglobe_workflows/cellfinder_core/cellfinder.py similarity index 100% rename from brainglobe_workflows/cellfinder_core/cellfinder_core.py rename to brainglobe_workflows/cellfinder_core/cellfinder.py diff --git a/pyproject.toml b/pyproject.toml index f7ce8d62..0c464945 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,7 +81,7 @@ napari = [ "Source Code" = "https://github.com/brainglobe/brainglobe-workflows" [project.scripts] -cellfinder-workflow = "brainglobe_workflows.cellfinder_core.cellfinder_core:main_app_wrapper" +cellfinder-workflow = "brainglobe_workflows.cellfinder_core.cellfinder:main_app_wrapper" cellfinder = "brainglobe_workflows.cellfinder_brainreg.main:main" [build-system] diff --git a/tests/cellfinder_core/conftest.py b/tests/cellfinder_core/conftest.py index 7e115705..749d83d3 100644 --- a/tests/cellfinder_core/conftest.py +++ b/tests/cellfinder_core/conftest.py @@ -5,7 +5,7 @@ import pooch import pytest -from brainglobe_workflows.cellfinder_core.cellfinder_core import ( +from brainglobe_workflows.cellfinder_core.cellfinder import ( read_cellfinder_config, ) diff --git a/tests/cellfinder_core/test_integration/test_cellfinder.py b/tests/cellfinder_core/test_integration/test_cellfinder.py index 38063ddb..1bd120ba 100644 --- a/tests/cellfinder_core/test_integration/test_cellfinder.py +++ b/tests/cellfinder_core/test_integration/test_cellfinder.py @@ -5,7 +5,7 @@ import pytest -from brainglobe_workflows.cellfinder_core.cellfinder_core import main +from brainglobe_workflows.cellfinder_core.cellfinder import main @pytest.mark.parametrize( @@ -87,7 +87,7 @@ def test_script( Path(__file__).resolve().parents[3] / "brainglobe_workflows" / "cellfinder_core" - / "cellfinder_core.py" + / "cellfinder.py" ) subprocess_input = [ sys.executable, diff --git a/tests/cellfinder_core/test_unit/test_cellfinder.py b/tests/cellfinder_core/test_unit/test_cellfinder.py index ee339de3..87f65623 100644 --- a/tests/cellfinder_core/test_unit/test_cellfinder.py +++ b/tests/cellfinder_core/test_unit/test_cellfinder.py @@ -6,16 +6,14 @@ import pooch import pytest -from brainglobe_workflows.cellfinder_core.cellfinder_core import ( +from brainglobe_workflows.cellfinder_core.cellfinder import ( CellfinderConfig, add_signal_and_background_files, read_cellfinder_config, run_workflow_from_cellfinder_run, setup_workflow, ) -from brainglobe_workflows.cellfinder_core.cellfinder_core import ( - setup as setup_full, -) +from brainglobe_workflows.cellfinder_core.cellfinder import setup as setup_full from brainglobe_workflows.utils import setup_logger @@ -29,9 +27,7 @@ def default_input_config_cellfinder() -> Path: Path to default input config """ - from brainglobe_workflows.utils import ( - DEFAULT_JSON_CONFIG_PATH_CELLFINDER, - ) + from brainglobe_workflows.utils import DEFAULT_JSON_CONFIG_PATH_CELLFINDER return DEFAULT_JSON_CONFIG_PATH_CELLFINDER