From 7eda3d7941991932ed30d5febde178c14443dc2d Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Thu, 14 Dec 2023 12:54:31 +0000 Subject: [PATCH 01/18] rename cellfinder workflow to cellfinder_core (to separate from cellfinder-brainreg CLI while keeping backwards comp) WIP --- .../{cellfinder.py => cellfinder_core.py} | 10 +++++++--- .../cellfinder_core}/__init__.py | 0 .../cellfinder_core.py} | 4 ++-- brainglobe_workflows/{ => cellfinder_core}/utils.py | 2 +- .../__init__.py | 0 tests/{ => cellfinder_core}/conftest.py | 6 ++++-- .../test_integration}/__init__.py | 0 .../brainglobe_benchmarks}/__init__.py | 0 .../brainglobe_benchmarks/test_cellfinder.py | 0 .../brainglobe_workflows}/__init__.py | 0 .../brainglobe_workflows/test_cellfinder.py | 2 +- .../test_unit}/__init__.py | 0 .../test_unit/brainglobe_benchmarks/__init__.py | 0 .../test_unit/brainglobe_workflows/__init__.py | 0 .../test_unit/brainglobe_workflows/conftest.py | 4 +++- .../brainglobe_workflows/test_cellfinder.py | 12 ++++++++---- .../test_unit/brainglobe_workflows/test_utils.py | 2 +- 17 files changed, 27 insertions(+), 15 deletions(-) rename brainglobe_benchmarks/{cellfinder.py => cellfinder_core.py} (96%) rename {tests/test_integration => brainglobe_workflows/cellfinder_core}/__init__.py (100%) rename brainglobe_workflows/{cellfinder.py => cellfinder_core/cellfinder_core.py} (98%) rename brainglobe_workflows/{ => cellfinder_core}/utils.py (97%) rename tests/{test_integration/brainglobe_benchmarks => cellfinder_core}/__init__.py (100%) rename tests/{ => cellfinder_core}/conftest.py (94%) rename tests/{test_integration/brainglobe_workflows => cellfinder_core/test_integration}/__init__.py (100%) rename tests/{test_unit => cellfinder_core/test_integration/brainglobe_benchmarks}/__init__.py (100%) rename tests/{ => cellfinder_core}/test_integration/brainglobe_benchmarks/test_cellfinder.py (100%) rename tests/{test_unit/brainglobe_benchmarks => cellfinder_core/test_integration/brainglobe_workflows}/__init__.py (100%) rename tests/{ => cellfinder_core}/test_integration/brainglobe_workflows/test_cellfinder.py (98%) rename tests/{test_unit/brainglobe_workflows => cellfinder_core/test_unit}/__init__.py (100%) create mode 100644 tests/cellfinder_core/test_unit/brainglobe_benchmarks/__init__.py create mode 100644 tests/cellfinder_core/test_unit/brainglobe_workflows/__init__.py rename tests/{ => cellfinder_core}/test_unit/brainglobe_workflows/conftest.py (69%) rename tests/{ => cellfinder_core}/test_unit/brainglobe_workflows/test_cellfinder.py (96%) rename tests/{ => cellfinder_core}/test_unit/brainglobe_workflows/test_utils.py (93%) diff --git a/brainglobe_benchmarks/cellfinder.py b/brainglobe_benchmarks/cellfinder_core.py similarity index 96% rename from brainglobe_benchmarks/cellfinder.py rename to brainglobe_benchmarks/cellfinder_core.py index e471aad7..8b1f6959 100644 --- a/brainglobe_benchmarks/cellfinder.py +++ b/brainglobe_benchmarks/cellfinder_core.py @@ -7,12 +7,16 @@ from cellfinder_core.main import main as cellfinder_run from cellfinder_core.tools.IO import read_with_dask -from brainglobe_workflows.cellfinder import ( +from brainglobe_workflows.cellfinder_core.cellfinder_core import ( CellfinderConfig, run_workflow_from_cellfinder_run, ) -from brainglobe_workflows.cellfinder import setup as setup_cellfinder_workflow -from brainglobe_workflows.utils import DEFAULT_JSON_CONFIG_PATH_CELLFINDER +from brainglobe_workflows.cellfinder_core.cellfinder_core import ( + setup as setup_cellfinder_workflow, +) +from brainglobe_workflows.cellfinder_core.utils import ( + DEFAULT_JSON_CONFIG_PATH_CELLFINDER, +) class TimeBenchmarkPrepGIN: diff --git a/tests/test_integration/__init__.py b/brainglobe_workflows/cellfinder_core/__init__.py similarity index 100% rename from tests/test_integration/__init__.py rename to brainglobe_workflows/cellfinder_core/__init__.py diff --git a/brainglobe_workflows/cellfinder.py b/brainglobe_workflows/cellfinder_core/cellfinder_core.py similarity index 98% rename from brainglobe_workflows/cellfinder.py rename to brainglobe_workflows/cellfinder_core/cellfinder_core.py index ec6dfa60..93670279 100644 --- a/brainglobe_workflows/cellfinder.py +++ b/brainglobe_workflows/cellfinder_core/cellfinder_core.py @@ -33,12 +33,12 @@ from cellfinder_core.tools.IO import read_with_dask from cellfinder_core.train.train_yml import depth_type -from brainglobe_workflows.utils import ( +from brainglobe_workflows.cellfinder_core.utils import ( DEFAULT_JSON_CONFIG_PATH_CELLFINDER, config_parser, setup_logger, ) -from brainglobe_workflows.utils import __name__ as LOGGER_NAME +from brainglobe_workflows.cellfinder_core.utils import __name__ as LOGGER_NAME Pathlike = Union[str, os.PathLike] diff --git a/brainglobe_workflows/utils.py b/brainglobe_workflows/cellfinder_core/utils.py similarity index 97% rename from brainglobe_workflows/utils.py rename to brainglobe_workflows/cellfinder_core/utils.py index 4b3bdac3..717ca7e9 100644 --- a/brainglobe_workflows/utils.py +++ b/brainglobe_workflows/cellfinder_core/utils.py @@ -4,7 +4,7 @@ from pathlib import Path from typing import List -DEFAULT_JSON_CONFIGS_PATH = Path(__file__).resolve().parent / "configs" +DEFAULT_JSON_CONFIGS_PATH = Path(__file__).resolve().parents[1] / "configs" DEFAULT_JSON_CONFIG_PATH_CELLFINDER = ( DEFAULT_JSON_CONFIGS_PATH / "cellfinder.json" diff --git a/tests/test_integration/brainglobe_benchmarks/__init__.py b/tests/cellfinder_core/__init__.py similarity index 100% rename from tests/test_integration/brainglobe_benchmarks/__init__.py rename to tests/cellfinder_core/__init__.py diff --git a/tests/conftest.py b/tests/cellfinder_core/conftest.py similarity index 94% rename from tests/conftest.py rename to tests/cellfinder_core/conftest.py index 83e05553..7e115705 100644 --- a/tests/conftest.py +++ b/tests/cellfinder_core/conftest.py @@ -5,7 +5,9 @@ import pooch import pytest -from brainglobe_workflows.cellfinder import read_cellfinder_config +from brainglobe_workflows.cellfinder_core.cellfinder_core import ( + read_cellfinder_config, +) @pytest.fixture() @@ -18,7 +20,7 @@ def input_configs_dir() -> Path: Path Test data directory path """ - return Path(__file__).parent / "data" + return Path(__file__).parents[1] / "data" @pytest.fixture(scope="session") diff --git a/tests/test_integration/brainglobe_workflows/__init__.py b/tests/cellfinder_core/test_integration/__init__.py similarity index 100% rename from tests/test_integration/brainglobe_workflows/__init__.py rename to tests/cellfinder_core/test_integration/__init__.py diff --git a/tests/test_unit/__init__.py b/tests/cellfinder_core/test_integration/brainglobe_benchmarks/__init__.py similarity index 100% rename from tests/test_unit/__init__.py rename to tests/cellfinder_core/test_integration/brainglobe_benchmarks/__init__.py diff --git a/tests/test_integration/brainglobe_benchmarks/test_cellfinder.py b/tests/cellfinder_core/test_integration/brainglobe_benchmarks/test_cellfinder.py similarity index 100% rename from tests/test_integration/brainglobe_benchmarks/test_cellfinder.py rename to tests/cellfinder_core/test_integration/brainglobe_benchmarks/test_cellfinder.py diff --git a/tests/test_unit/brainglobe_benchmarks/__init__.py b/tests/cellfinder_core/test_integration/brainglobe_workflows/__init__.py similarity index 100% rename from tests/test_unit/brainglobe_benchmarks/__init__.py rename to tests/cellfinder_core/test_integration/brainglobe_workflows/__init__.py diff --git a/tests/test_integration/brainglobe_workflows/test_cellfinder.py b/tests/cellfinder_core/test_integration/brainglobe_workflows/test_cellfinder.py similarity index 98% rename from tests/test_integration/brainglobe_workflows/test_cellfinder.py rename to tests/cellfinder_core/test_integration/brainglobe_workflows/test_cellfinder.py index 1f179b7b..ae4798fc 100644 --- a/tests/test_integration/brainglobe_workflows/test_cellfinder.py +++ b/tests/cellfinder_core/test_integration/brainglobe_workflows/test_cellfinder.py @@ -5,7 +5,7 @@ import pytest -from brainglobe_workflows.cellfinder import main +from brainglobe_workflows.cellfinder_core.cellfinder_core import main @pytest.mark.parametrize( diff --git a/tests/test_unit/brainglobe_workflows/__init__.py b/tests/cellfinder_core/test_unit/__init__.py similarity index 100% rename from tests/test_unit/brainglobe_workflows/__init__.py rename to tests/cellfinder_core/test_unit/__init__.py diff --git a/tests/cellfinder_core/test_unit/brainglobe_benchmarks/__init__.py b/tests/cellfinder_core/test_unit/brainglobe_benchmarks/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/cellfinder_core/test_unit/brainglobe_workflows/__init__.py b/tests/cellfinder_core/test_unit/brainglobe_workflows/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_unit/brainglobe_workflows/conftest.py b/tests/cellfinder_core/test_unit/brainglobe_workflows/conftest.py similarity index 69% rename from tests/test_unit/brainglobe_workflows/conftest.py rename to tests/cellfinder_core/test_unit/brainglobe_workflows/conftest.py index ae85bc53..13d6b859 100644 --- a/tests/test_unit/brainglobe_workflows/conftest.py +++ b/tests/cellfinder_core/test_unit/brainglobe_workflows/conftest.py @@ -10,6 +10,8 @@ def custom_logger_name() -> str: str Name of custom logger """ - from brainglobe_workflows.utils import __name__ as logger_name + from brainglobe_workflows.cellfinder_core.utils import ( + __name__ as logger_name, + ) return logger_name diff --git a/tests/test_unit/brainglobe_workflows/test_cellfinder.py b/tests/cellfinder_core/test_unit/brainglobe_workflows/test_cellfinder.py similarity index 96% rename from tests/test_unit/brainglobe_workflows/test_cellfinder.py rename to tests/cellfinder_core/test_unit/brainglobe_workflows/test_cellfinder.py index ddb4c706..08d4db38 100644 --- a/tests/test_unit/brainglobe_workflows/test_cellfinder.py +++ b/tests/cellfinder_core/test_unit/brainglobe_workflows/test_cellfinder.py @@ -6,15 +6,17 @@ import pooch import pytest -from brainglobe_workflows.cellfinder import ( +from brainglobe_workflows.cellfinder_core.cellfinder_core import ( CellfinderConfig, add_signal_and_background_files, read_cellfinder_config, run_workflow_from_cellfinder_run, setup_workflow, ) -from brainglobe_workflows.cellfinder import setup as setup_full -from brainglobe_workflows.utils import setup_logger +from brainglobe_workflows.cellfinder_core.cellfinder_core import ( + setup as setup_full, +) +from brainglobe_workflows.cellfinder_core.utils import setup_logger @pytest.fixture() @@ -27,7 +29,9 @@ def default_input_config_cellfinder() -> Path: Path to default input config """ - from brainglobe_workflows.utils import DEFAULT_JSON_CONFIG_PATH_CELLFINDER + from brainglobe_workflows.cellfinder_core.utils import ( + DEFAULT_JSON_CONFIG_PATH_CELLFINDER, + ) return DEFAULT_JSON_CONFIG_PATH_CELLFINDER diff --git a/tests/test_unit/brainglobe_workflows/test_utils.py b/tests/cellfinder_core/test_unit/brainglobe_workflows/test_utils.py similarity index 93% rename from tests/test_unit/brainglobe_workflows/test_utils.py rename to tests/cellfinder_core/test_unit/brainglobe_workflows/test_utils.py index 2ec8d19e..bf2a76cf 100644 --- a/tests/test_unit/brainglobe_workflows/test_utils.py +++ b/tests/cellfinder_core/test_unit/brainglobe_workflows/test_utils.py @@ -3,7 +3,7 @@ import pytest -from brainglobe_workflows.utils import ( +from brainglobe_workflows.cellfinder_core.utils import ( DEFAULT_JSON_CONFIG_PATH_CELLFINDER, config_parser, setup_logger, From a4b73248f357777668b5244109f7cf88ed7abacd Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:06:27 +0000 Subject: [PATCH 02/18] rename benchmarks. rename cellfinder CLI tool to cellfinder_brainreg --- MANIFEST.in | 4 ++-- {brainglobe_benchmarks => benchmarks}/__init__.py | 0 {brainglobe_benchmarks => benchmarks}/cellfinder_core.py | 0 .../{analyse => cellfinder_brainreg}/__init__.py | 0 .../{export => cellfinder_brainreg/analyse}/__init__.py | 0 .../{ => cellfinder_brainreg}/analyse/analyse.py | 0 .../{extract => cellfinder_brainreg/export}/__init__.py | 0 .../{ => cellfinder_brainreg}/export/abc4d.py | 0 .../{ => cellfinder_brainreg}/export/brainrender.py | 0 .../{ => cellfinder_brainreg}/export/export.py | 0 .../{figures => cellfinder_brainreg/extract}/__init__.py | 0 .../{ => cellfinder_brainreg}/extract/extract_cubes.py | 0 .../{tools => cellfinder_brainreg/figures}/__init__.py | 0 .../{ => cellfinder_brainreg}/figures/figures.py | 0 .../{ => cellfinder_brainreg}/figures/heatmap.py | 0 brainglobe_workflows/{ => cellfinder_brainreg}/main.py | 0 brainglobe_workflows/cellfinder_brainreg/tools/__init__.py | 0 .../{ => cellfinder_brainreg}/tools/image_processing.py | 0 .../{ => cellfinder_brainreg}/tools/parser.py | 0 brainglobe_workflows/{ => cellfinder_brainreg}/tools/prep.py | 0 .../{ => cellfinder_brainreg}/tools/system.py | 0 brainglobe_workflows/{ => cellfinder_brainreg}/tools/tools.py | 0 brainglobe_workflows/{cellfinder_core => }/utils.py | 0 tests/{cellfinder => cellfinder_brainreg}/conftest.py | 0 .../test_integration/test_detection.py | 0 .../test_integration/test_extract.py | 0 .../test_integration/test_registration.py | 0 .../test_unit/test_analyse.py | 0 .../test_unit/test_tools/test_image_processing.py | 0 .../test_unit/test_tools/test_prep.py | 0 .../test_unit/test_tools/test_system.py | 0 .../test_unit/test_tools/test_tools_general.py | 0 32 files changed, 2 insertions(+), 2 deletions(-) rename {brainglobe_benchmarks => benchmarks}/__init__.py (100%) rename {brainglobe_benchmarks => benchmarks}/cellfinder_core.py (100%) rename brainglobe_workflows/{analyse => cellfinder_brainreg}/__init__.py (100%) rename brainglobe_workflows/{export => cellfinder_brainreg/analyse}/__init__.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/analyse/analyse.py (100%) rename brainglobe_workflows/{extract => cellfinder_brainreg/export}/__init__.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/export/abc4d.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/export/brainrender.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/export/export.py (100%) rename brainglobe_workflows/{figures => cellfinder_brainreg/extract}/__init__.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/extract/extract_cubes.py (100%) rename brainglobe_workflows/{tools => cellfinder_brainreg/figures}/__init__.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/figures/figures.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/figures/heatmap.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/main.py (100%) create mode 100644 brainglobe_workflows/cellfinder_brainreg/tools/__init__.py rename brainglobe_workflows/{ => cellfinder_brainreg}/tools/image_processing.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/tools/parser.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/tools/prep.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/tools/system.py (100%) rename brainglobe_workflows/{ => cellfinder_brainreg}/tools/tools.py (100%) rename brainglobe_workflows/{cellfinder_core => }/utils.py (100%) rename tests/{cellfinder => cellfinder_brainreg}/conftest.py (100%) rename tests/{cellfinder => cellfinder_brainreg}/test_integration/test_detection.py (100%) rename tests/{cellfinder => cellfinder_brainreg}/test_integration/test_extract.py (100%) rename tests/{cellfinder => cellfinder_brainreg}/test_integration/test_registration.py (100%) rename tests/{cellfinder => cellfinder_brainreg}/test_unit/test_analyse.py (100%) rename tests/{cellfinder => cellfinder_brainreg}/test_unit/test_tools/test_image_processing.py (100%) rename tests/{cellfinder => cellfinder_brainreg}/test_unit/test_tools/test_prep.py (100%) rename tests/{cellfinder => cellfinder_brainreg}/test_unit/test_tools/test_system.py (100%) rename tests/{cellfinder => cellfinder_brainreg}/test_unit/test_tools/test_tools_general.py (100%) diff --git a/MANIFEST.in b/MANIFEST.in index 2c5098f4..a726a7eb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,8 +9,8 @@ exclude *.ini recursive-include brainglobe_workflows *.py recursive-include brainglobe_workflows/configs *.json -recursive-include brainglobe_benchmarks *.py -recursive-exclude brainglobe_benchmarks/results * +recursive-include benchmarks *.py +recursive-exclude benchmarks/results * include asv.conf.json recursive-exclude * __pycache__ diff --git a/brainglobe_benchmarks/__init__.py b/benchmarks/__init__.py similarity index 100% rename from brainglobe_benchmarks/__init__.py rename to benchmarks/__init__.py diff --git a/brainglobe_benchmarks/cellfinder_core.py b/benchmarks/cellfinder_core.py similarity index 100% rename from brainglobe_benchmarks/cellfinder_core.py rename to benchmarks/cellfinder_core.py diff --git a/brainglobe_workflows/analyse/__init__.py b/brainglobe_workflows/cellfinder_brainreg/__init__.py similarity index 100% rename from brainglobe_workflows/analyse/__init__.py rename to brainglobe_workflows/cellfinder_brainreg/__init__.py diff --git a/brainglobe_workflows/export/__init__.py b/brainglobe_workflows/cellfinder_brainreg/analyse/__init__.py similarity index 100% rename from brainglobe_workflows/export/__init__.py rename to brainglobe_workflows/cellfinder_brainreg/analyse/__init__.py diff --git a/brainglobe_workflows/analyse/analyse.py b/brainglobe_workflows/cellfinder_brainreg/analyse/analyse.py similarity index 100% rename from brainglobe_workflows/analyse/analyse.py rename to brainglobe_workflows/cellfinder_brainreg/analyse/analyse.py diff --git a/brainglobe_workflows/extract/__init__.py b/brainglobe_workflows/cellfinder_brainreg/export/__init__.py similarity index 100% rename from brainglobe_workflows/extract/__init__.py rename to brainglobe_workflows/cellfinder_brainreg/export/__init__.py diff --git a/brainglobe_workflows/export/abc4d.py b/brainglobe_workflows/cellfinder_brainreg/export/abc4d.py similarity index 100% rename from brainglobe_workflows/export/abc4d.py rename to brainglobe_workflows/cellfinder_brainreg/export/abc4d.py diff --git a/brainglobe_workflows/export/brainrender.py b/brainglobe_workflows/cellfinder_brainreg/export/brainrender.py similarity index 100% rename from brainglobe_workflows/export/brainrender.py rename to brainglobe_workflows/cellfinder_brainreg/export/brainrender.py diff --git a/brainglobe_workflows/export/export.py b/brainglobe_workflows/cellfinder_brainreg/export/export.py similarity index 100% rename from brainglobe_workflows/export/export.py rename to brainglobe_workflows/cellfinder_brainreg/export/export.py diff --git a/brainglobe_workflows/figures/__init__.py b/brainglobe_workflows/cellfinder_brainreg/extract/__init__.py similarity index 100% rename from brainglobe_workflows/figures/__init__.py rename to brainglobe_workflows/cellfinder_brainreg/extract/__init__.py diff --git a/brainglobe_workflows/extract/extract_cubes.py b/brainglobe_workflows/cellfinder_brainreg/extract/extract_cubes.py similarity index 100% rename from brainglobe_workflows/extract/extract_cubes.py rename to brainglobe_workflows/cellfinder_brainreg/extract/extract_cubes.py diff --git a/brainglobe_workflows/tools/__init__.py b/brainglobe_workflows/cellfinder_brainreg/figures/__init__.py similarity index 100% rename from brainglobe_workflows/tools/__init__.py rename to brainglobe_workflows/cellfinder_brainreg/figures/__init__.py diff --git a/brainglobe_workflows/figures/figures.py b/brainglobe_workflows/cellfinder_brainreg/figures/figures.py similarity index 100% rename from brainglobe_workflows/figures/figures.py rename to brainglobe_workflows/cellfinder_brainreg/figures/figures.py diff --git a/brainglobe_workflows/figures/heatmap.py b/brainglobe_workflows/cellfinder_brainreg/figures/heatmap.py similarity index 100% rename from brainglobe_workflows/figures/heatmap.py rename to brainglobe_workflows/cellfinder_brainreg/figures/heatmap.py diff --git a/brainglobe_workflows/main.py b/brainglobe_workflows/cellfinder_brainreg/main.py similarity index 100% rename from brainglobe_workflows/main.py rename to brainglobe_workflows/cellfinder_brainreg/main.py diff --git a/brainglobe_workflows/cellfinder_brainreg/tools/__init__.py b/brainglobe_workflows/cellfinder_brainreg/tools/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/brainglobe_workflows/tools/image_processing.py b/brainglobe_workflows/cellfinder_brainreg/tools/image_processing.py similarity index 100% rename from brainglobe_workflows/tools/image_processing.py rename to brainglobe_workflows/cellfinder_brainreg/tools/image_processing.py diff --git a/brainglobe_workflows/tools/parser.py b/brainglobe_workflows/cellfinder_brainreg/tools/parser.py similarity index 100% rename from brainglobe_workflows/tools/parser.py rename to brainglobe_workflows/cellfinder_brainreg/tools/parser.py diff --git a/brainglobe_workflows/tools/prep.py b/brainglobe_workflows/cellfinder_brainreg/tools/prep.py similarity index 100% rename from brainglobe_workflows/tools/prep.py rename to brainglobe_workflows/cellfinder_brainreg/tools/prep.py diff --git a/brainglobe_workflows/tools/system.py b/brainglobe_workflows/cellfinder_brainreg/tools/system.py similarity index 100% rename from brainglobe_workflows/tools/system.py rename to brainglobe_workflows/cellfinder_brainreg/tools/system.py diff --git a/brainglobe_workflows/tools/tools.py b/brainglobe_workflows/cellfinder_brainreg/tools/tools.py similarity index 100% rename from brainglobe_workflows/tools/tools.py rename to brainglobe_workflows/cellfinder_brainreg/tools/tools.py diff --git a/brainglobe_workflows/cellfinder_core/utils.py b/brainglobe_workflows/utils.py similarity index 100% rename from brainglobe_workflows/cellfinder_core/utils.py rename to brainglobe_workflows/utils.py diff --git a/tests/cellfinder/conftest.py b/tests/cellfinder_brainreg/conftest.py similarity index 100% rename from tests/cellfinder/conftest.py rename to tests/cellfinder_brainreg/conftest.py diff --git a/tests/cellfinder/test_integration/test_detection.py b/tests/cellfinder_brainreg/test_integration/test_detection.py similarity index 100% rename from tests/cellfinder/test_integration/test_detection.py rename to tests/cellfinder_brainreg/test_integration/test_detection.py diff --git a/tests/cellfinder/test_integration/test_extract.py b/tests/cellfinder_brainreg/test_integration/test_extract.py similarity index 100% rename from tests/cellfinder/test_integration/test_extract.py rename to tests/cellfinder_brainreg/test_integration/test_extract.py diff --git a/tests/cellfinder/test_integration/test_registration.py b/tests/cellfinder_brainreg/test_integration/test_registration.py similarity index 100% rename from tests/cellfinder/test_integration/test_registration.py rename to tests/cellfinder_brainreg/test_integration/test_registration.py diff --git a/tests/cellfinder/test_unit/test_analyse.py b/tests/cellfinder_brainreg/test_unit/test_analyse.py similarity index 100% rename from tests/cellfinder/test_unit/test_analyse.py rename to tests/cellfinder_brainreg/test_unit/test_analyse.py diff --git a/tests/cellfinder/test_unit/test_tools/test_image_processing.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_image_processing.py similarity index 100% rename from tests/cellfinder/test_unit/test_tools/test_image_processing.py rename to tests/cellfinder_brainreg/test_unit/test_tools/test_image_processing.py diff --git a/tests/cellfinder/test_unit/test_tools/test_prep.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_prep.py similarity index 100% rename from tests/cellfinder/test_unit/test_tools/test_prep.py rename to tests/cellfinder_brainreg/test_unit/test_tools/test_prep.py diff --git a/tests/cellfinder/test_unit/test_tools/test_system.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_system.py similarity index 100% rename from tests/cellfinder/test_unit/test_tools/test_system.py rename to tests/cellfinder_brainreg/test_unit/test_tools/test_system.py diff --git a/tests/cellfinder/test_unit/test_tools/test_tools_general.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_tools_general.py similarity index 100% rename from tests/cellfinder/test_unit/test_tools/test_tools_general.py rename to tests/cellfinder_brainreg/test_unit/test_tools/test_tools_general.py From 4cd6609243afb367826f005e5a666fc615513d50 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:09:56 +0000 Subject: [PATCH 03/18] reorganise tests --- .../brainglobe_benchmarks => benchmarks}/__init__.py | 0 .../brainglobe_benchmarks => benchmarks}/test_cellfinder.py | 0 .../test_integration/brainglobe_workflows/__init__.py | 0 .../{brainglobe_workflows => }/test_cellfinder.py | 0 .../test_unit/brainglobe_benchmarks/__init__.py | 0 .../test_unit/brainglobe_workflows/__init__.py | 0 .../test_unit/{brainglobe_workflows => }/conftest.py | 2 +- .../test_unit/{brainglobe_workflows => }/test_cellfinder.py | 4 ++-- .../test_unit/{brainglobe_workflows => }/test_utils.py | 2 +- 9 files changed, 4 insertions(+), 4 deletions(-) rename tests/{cellfinder_core/test_integration/brainglobe_benchmarks => benchmarks}/__init__.py (100%) rename tests/{cellfinder_core/test_integration/brainglobe_benchmarks => benchmarks}/test_cellfinder.py (100%) delete mode 100644 tests/cellfinder_core/test_integration/brainglobe_workflows/__init__.py rename tests/cellfinder_core/test_integration/{brainglobe_workflows => }/test_cellfinder.py (100%) delete mode 100644 tests/cellfinder_core/test_unit/brainglobe_benchmarks/__init__.py delete mode 100644 tests/cellfinder_core/test_unit/brainglobe_workflows/__init__.py rename tests/cellfinder_core/test_unit/{brainglobe_workflows => }/conftest.py (81%) rename tests/cellfinder_core/test_unit/{brainglobe_workflows => }/test_cellfinder.py (98%) rename tests/cellfinder_core/test_unit/{brainglobe_workflows => }/test_utils.py (93%) diff --git a/tests/cellfinder_core/test_integration/brainglobe_benchmarks/__init__.py b/tests/benchmarks/__init__.py similarity index 100% rename from tests/cellfinder_core/test_integration/brainglobe_benchmarks/__init__.py rename to tests/benchmarks/__init__.py diff --git a/tests/cellfinder_core/test_integration/brainglobe_benchmarks/test_cellfinder.py b/tests/benchmarks/test_cellfinder.py similarity index 100% rename from tests/cellfinder_core/test_integration/brainglobe_benchmarks/test_cellfinder.py rename to tests/benchmarks/test_cellfinder.py diff --git a/tests/cellfinder_core/test_integration/brainglobe_workflows/__init__.py b/tests/cellfinder_core/test_integration/brainglobe_workflows/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/cellfinder_core/test_integration/brainglobe_workflows/test_cellfinder.py b/tests/cellfinder_core/test_integration/test_cellfinder.py similarity index 100% rename from tests/cellfinder_core/test_integration/brainglobe_workflows/test_cellfinder.py rename to tests/cellfinder_core/test_integration/test_cellfinder.py diff --git a/tests/cellfinder_core/test_unit/brainglobe_benchmarks/__init__.py b/tests/cellfinder_core/test_unit/brainglobe_benchmarks/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/cellfinder_core/test_unit/brainglobe_workflows/__init__.py b/tests/cellfinder_core/test_unit/brainglobe_workflows/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/cellfinder_core/test_unit/brainglobe_workflows/conftest.py b/tests/cellfinder_core/test_unit/conftest.py similarity index 81% rename from tests/cellfinder_core/test_unit/brainglobe_workflows/conftest.py rename to tests/cellfinder_core/test_unit/conftest.py index 13d6b859..57492be5 100644 --- a/tests/cellfinder_core/test_unit/brainglobe_workflows/conftest.py +++ b/tests/cellfinder_core/test_unit/conftest.py @@ -10,7 +10,7 @@ def custom_logger_name() -> str: str Name of custom logger """ - from brainglobe_workflows.cellfinder_core.utils import ( + from brainglobe_workflows.utils import ( __name__ as logger_name, ) diff --git a/tests/cellfinder_core/test_unit/brainglobe_workflows/test_cellfinder.py b/tests/cellfinder_core/test_unit/test_cellfinder.py similarity index 98% rename from tests/cellfinder_core/test_unit/brainglobe_workflows/test_cellfinder.py rename to tests/cellfinder_core/test_unit/test_cellfinder.py index 08d4db38..ee339de3 100644 --- a/tests/cellfinder_core/test_unit/brainglobe_workflows/test_cellfinder.py +++ b/tests/cellfinder_core/test_unit/test_cellfinder.py @@ -16,7 +16,7 @@ from brainglobe_workflows.cellfinder_core.cellfinder_core import ( setup as setup_full, ) -from brainglobe_workflows.cellfinder_core.utils import setup_logger +from brainglobe_workflows.utils import setup_logger @pytest.fixture() @@ -29,7 +29,7 @@ def default_input_config_cellfinder() -> Path: Path to default input config """ - from brainglobe_workflows.cellfinder_core.utils import ( + from brainglobe_workflows.utils import ( DEFAULT_JSON_CONFIG_PATH_CELLFINDER, ) diff --git a/tests/cellfinder_core/test_unit/brainglobe_workflows/test_utils.py b/tests/cellfinder_core/test_unit/test_utils.py similarity index 93% rename from tests/cellfinder_core/test_unit/brainglobe_workflows/test_utils.py rename to tests/cellfinder_core/test_unit/test_utils.py index bf2a76cf..2ec8d19e 100644 --- a/tests/cellfinder_core/test_unit/brainglobe_workflows/test_utils.py +++ b/tests/cellfinder_core/test_unit/test_utils.py @@ -3,7 +3,7 @@ import pytest -from brainglobe_workflows.cellfinder_core.utils import ( +from brainglobe_workflows.utils import ( DEFAULT_JSON_CONFIG_PATH_CELLFINDER, config_parser, setup_logger, From 3423bffb990adc268f71f813e26eec817fedadeb Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:30:41 +0000 Subject: [PATCH 04/18] rename to cellfinder_brainreg in entrypoint --- pyproject.toml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6689ae2b..9bb04caf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,7 +68,7 @@ napari = [ [project.scripts] cellfinder-workflow = "brainglobe_workflows.cellfinder:main_app_wrapper" -cellfinder = "brainglobe_workflows.main:main" +cellfinder = "brainglobe_workflows.cellfinder_brainreg.main:main" [build-system] requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2"] @@ -97,7 +97,10 @@ archs = ["x86_64", "arm64"] [tool.check-manifest] [tool.pytest.ini_options] -addopts = "--cov=brainglobe_workflows" +addopts = "--cov=brainglobe-workflows" +# markers = +# slow: marks tests as slow (deselect with '-m "not slow"') +# serial [tool.ruff] line-length = 79 From 47aa692bc8df62bd67dc866f57e769840295714d Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:32:12 +0000 Subject: [PATCH 05/18] integrate pytest.ini in pyproject.toml --- pyproject.toml | 8 ++++---- pytest.ini | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 pytest.ini diff --git a/pyproject.toml b/pyproject.toml index 9bb04caf..26060357 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,10 +98,10 @@ archs = ["x86_64", "arm64"] [tool.pytest.ini_options] addopts = "--cov=brainglobe-workflows" -# markers = -# slow: marks tests as slow (deselect with '-m "not slow"') -# serial - +markers = [ + "slow: marks tests as slow (deselect with '-m \"not slow\"')", + "serial", +] [tool.ruff] line-length = 79 exclude = ["__init__.py", "build", ".eggs"] diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 084521dc..00000000 --- a/pytest.ini +++ /dev/null @@ -1,5 +0,0 @@ -[pytest] -addopts = --cov=brainglobe-workflows -markers = - slow: marks tests as slow (deselect with '-m "not slow"') - serial From c9f2921c9eb5299d3a3cda23916c4521cf7d5d5d Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:35:22 +0000 Subject: [PATCH 06/18] rename cellfinder to cellfinder_brainreg --- .../cellfinder_brainreg/analyse/analyse.py | 4 +++- .../cellfinder_brainreg/export/export.py | 6 ++++-- .../cellfinder_brainreg/extract/extract_cubes.py | 6 ++++-- .../cellfinder_brainreg/figures/figures.py | 2 +- brainglobe_workflows/cellfinder_brainreg/main.py | 8 ++++---- brainglobe_workflows/cellfinder_brainreg/tools/prep.py | 8 +++++--- brainglobe_workflows/cellfinder_core/cellfinder_core.py | 4 ++-- .../test_integration/test_detection.py | 9 ++++++--- .../cellfinder_brainreg/test_integration/test_extract.py | 4 +++- .../test_integration/test_registration.py | 4 +++- tests/cellfinder_brainreg/test_unit/test_analyse.py | 5 ++++- .../test_unit/test_tools/test_image_processing.py | 4 +++- .../test_unit/test_tools/test_prep.py | 2 +- .../test_unit/test_tools/test_system.py | 4 ++-- .../test_unit/test_tools/test_tools_general.py | 2 +- 15 files changed, 46 insertions(+), 26 deletions(-) diff --git a/brainglobe_workflows/cellfinder_brainreg/analyse/analyse.py b/brainglobe_workflows/cellfinder_brainreg/analyse/analyse.py index f1b5779e..822eaf89 100644 --- a/brainglobe_workflows/cellfinder_brainreg/analyse/analyse.py +++ b/brainglobe_workflows/cellfinder_brainreg/analyse/analyse.py @@ -18,7 +18,9 @@ from brainglobe_utils.general.system import ensure_directory_exists from brainglobe_utils.pandas.misc import safe_pandas_concat, sanitise_df -from brainglobe_workflows.export.export import export_points +from brainglobe_workflows.cellfinder_brainreg.export.export import ( + export_points, +) class Point: diff --git a/brainglobe_workflows/cellfinder_brainreg/export/export.py b/brainglobe_workflows/cellfinder_brainreg/export/export.py index 30a8dccb..c40eaf95 100644 --- a/brainglobe_workflows/cellfinder_brainreg/export/export.py +++ b/brainglobe_workflows/cellfinder_brainreg/export/export.py @@ -1,5 +1,7 @@ -from brainglobe_workflows.export.abc4d import export_points as abc4d_export -from brainglobe_workflows.export.brainrender import ( +from brainglobe_workflows.cellfinder_brainreg.export.abc4d import ( + export_points as abc4d_export, +) +from brainglobe_workflows.cellfinder_brainreg.export.brainrender import ( export_points as brainrender_export, ) diff --git a/brainglobe_workflows/cellfinder_brainreg/extract/extract_cubes.py b/brainglobe_workflows/cellfinder_brainreg/extract/extract_cubes.py index d3b5763c..5a19593b 100644 --- a/brainglobe_workflows/cellfinder_brainreg/extract/extract_cubes.py +++ b/brainglobe_workflows/cellfinder_brainreg/extract/extract_cubes.py @@ -22,8 +22,10 @@ from tifffile import tifffile from tqdm import tqdm -from brainglobe_workflows.tools import image_processing as img_tools -from brainglobe_workflows.tools import system +from brainglobe_workflows.cellfinder_brainreg.tools import ( + image_processing as img_tools, +) +from brainglobe_workflows.cellfinder_brainreg.tools import system class StackSizeError(Exception): diff --git a/brainglobe_workflows/cellfinder_brainreg/figures/figures.py b/brainglobe_workflows/cellfinder_brainreg/figures/figures.py index 13b2f21c..491e5ac3 100644 --- a/brainglobe_workflows/cellfinder_brainreg/figures/figures.py +++ b/brainglobe_workflows/cellfinder_brainreg/figures/figures.py @@ -1,6 +1,6 @@ import logging -from brainglobe_workflows.figures import heatmap +from brainglobe_workflows.cellfinder_brainreg.figures import heatmap def run(args, atlas, downsampled_shape): diff --git a/brainglobe_workflows/cellfinder_brainreg/main.py b/brainglobe_workflows/cellfinder_brainreg/main.py index 80c26902..5f1ae054 100644 --- a/brainglobe_workflows/cellfinder_brainreg/main.py +++ b/brainglobe_workflows/cellfinder_brainreg/main.py @@ -44,7 +44,7 @@ def main(): suppress_tf_logging(tf_suppress_log_messages) from brainreg.core.main import main as register - from brainglobe_workflows.tools import prep + from brainglobe_workflows.cellfinder_brainreg.tools import prep start_time = datetime.now() args, arg_groups, what_to_run, atlas = prep.prep_cellfinder_general() @@ -105,9 +105,9 @@ def run_all(args, what_to_run, atlas): from cellfinder_core.tools import prep from cellfinder_core.tools.IO import read_with_dask - from brainglobe_workflows.analyse import analyse - from brainglobe_workflows.figures import figures - from brainglobe_workflows.tools.prep import ( + from brainglobe_workflows.cellfinder_brainreg.analyse import analyse + from brainglobe_workflows.cellfinder_brainreg.figures import figures + from brainglobe_workflows.cellfinder_brainreg.tools.prep import ( prep_candidate_detection, prep_channel_specific_general, ) diff --git a/brainglobe_workflows/cellfinder_brainreg/tools/prep.py b/brainglobe_workflows/cellfinder_brainreg/tools/prep.py index fcad3c64..318f28b8 100644 --- a/brainglobe_workflows/cellfinder_brainreg/tools/prep.py +++ b/brainglobe_workflows/cellfinder_brainreg/tools/prep.py @@ -18,9 +18,11 @@ from fancylog import fancylog import brainglobe_workflows as program_for_log -import brainglobe_workflows.tools.parser as parser -from brainglobe_workflows.tools import system, tools -from brainglobe_workflows.tools.parser import cellfinder_parser +import brainglobe_workflows.cellfinder_brainreg.tools.parser as parser +from brainglobe_workflows.cellfinder_brainreg.tools import system, tools +from brainglobe_workflows.cellfinder_brainreg.tools.parser import ( + cellfinder_parser, +) def get_arg_groups(args, parser): diff --git a/brainglobe_workflows/cellfinder_core/cellfinder_core.py b/brainglobe_workflows/cellfinder_core/cellfinder_core.py index 93670279..ec6dfa60 100644 --- a/brainglobe_workflows/cellfinder_core/cellfinder_core.py +++ b/brainglobe_workflows/cellfinder_core/cellfinder_core.py @@ -33,12 +33,12 @@ from cellfinder_core.tools.IO import read_with_dask from cellfinder_core.train.train_yml import depth_type -from brainglobe_workflows.cellfinder_core.utils import ( +from brainglobe_workflows.utils import ( DEFAULT_JSON_CONFIG_PATH_CELLFINDER, config_parser, setup_logger, ) -from brainglobe_workflows.cellfinder_core.utils import __name__ as LOGGER_NAME +from brainglobe_workflows.utils import __name__ as LOGGER_NAME Pathlike = Union[str, os.PathLike] diff --git a/tests/cellfinder_brainreg/test_integration/test_detection.py b/tests/cellfinder_brainreg/test_integration/test_detection.py index 52f180d3..4e3c683c 100644 --- a/tests/cellfinder_brainreg/test_integration/test_detection.py +++ b/tests/cellfinder_brainreg/test_integration/test_detection.py @@ -1,14 +1,17 @@ import os import sys from math import isclose +from pathlib import Path import brainglobe_utils.IO.cells as cell_io import pytest -from brainglobe_workflows.main import main as cellfinder_run +from brainglobe_workflows.cellfinder_brainreg.main import ( + main as cellfinder_run, +) -data_dir = os.path.join( - os.getcwd(), "tests", "data", "integration", "detection" +data_dir = Path(__file__).parents[3] / Path( + "tests", "data", "integration", "detection" ) signal_data = os.path.join(data_dir, "crop_planes", "ch0") background_data = os.path.join(data_dir, "crop_planes", "ch1") diff --git a/tests/cellfinder_brainreg/test_integration/test_extract.py b/tests/cellfinder_brainreg/test_integration/test_extract.py index 06786bbd..5c526230 100644 --- a/tests/cellfinder_brainreg/test_integration/test_extract.py +++ b/tests/cellfinder_brainreg/test_integration/test_extract.py @@ -11,7 +11,9 @@ from brainglobe_utils.IO.cells import get_cells from tifffile import tifffile -import brainglobe_workflows.extract.extract_cubes as extract_cubes +from brainglobe_workflows.cellfinder_brainreg.extract import ( + extract_cubes as extract_cubes, +) data_dir = os.path.join("tests", "data") diff --git a/tests/cellfinder_brainreg/test_integration/test_registration.py b/tests/cellfinder_brainreg/test_integration/test_registration.py index 27c05921..ea89f26a 100644 --- a/tests/cellfinder_brainreg/test_integration/test_registration.py +++ b/tests/cellfinder_brainreg/test_integration/test_registration.py @@ -7,7 +7,9 @@ import pytest from imio.load import load_any -from brainglobe_workflows.main import main as cellfinder_run +from brainglobe_workflows.cellfinder_brainreg.main import ( + main as cellfinder_run, +) data_dir = os.path.join( os.getcwd(), diff --git a/tests/cellfinder_brainreg/test_unit/test_analyse.py b/tests/cellfinder_brainreg/test_unit/test_analyse.py index 94e2fe65..b61f44df 100644 --- a/tests/cellfinder_brainreg/test_unit/test_analyse.py +++ b/tests/cellfinder_brainreg/test_unit/test_analyse.py @@ -4,7 +4,10 @@ import pytest -from brainglobe_workflows.analyse.analyse import Point, get_region_totals +from brainglobe_workflows.cellfinder_brainreg.analyse.analyse import ( + Point, + get_region_totals, +) @pytest.fixture diff --git a/tests/cellfinder_brainreg/test_unit/test_tools/test_image_processing.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_image_processing.py index 0b7ed182..d54a371c 100644 --- a/tests/cellfinder_brainreg/test_unit/test_tools/test_image_processing.py +++ b/tests/cellfinder_brainreg/test_unit/test_tools/test_image_processing.py @@ -2,7 +2,9 @@ import numpy as np -from brainglobe_workflows.tools import image_processing as img_tools +from brainglobe_workflows.cellfinder_brainreg.tools import ( + image_processing as img_tools, +) def test_crop_center_2d(): diff --git a/tests/cellfinder_brainreg/test_unit/test_tools/test_prep.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_prep.py index 9c8f6a35..2ff1b2da 100644 --- a/tests/cellfinder_brainreg/test_unit/test_tools/test_prep.py +++ b/tests/cellfinder_brainreg/test_unit/test_tools/test_prep.py @@ -3,7 +3,7 @@ import pytest from brainglobe_utils.general.exceptions import CommandLineInputError -from brainglobe_workflows.tools import prep +from brainglobe_workflows.cellfinder_brainreg.tools import prep # import shutil diff --git a/tests/cellfinder_brainreg/test_unit/test_tools/test_system.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_system.py index 72675894..d2834d51 100644 --- a/tests/cellfinder_brainreg/test_unit/test_tools/test_system.py +++ b/tests/cellfinder_brainreg/test_unit/test_tools/test_system.py @@ -6,9 +6,9 @@ from brainglobe_utils.general.exceptions import CommandLineInputError from brainglobe_utils.general.system import ensure_directory_exists -import brainglobe_workflows.tools.system as system +import brainglobe_workflows.cellfinder_brainreg.tools.system as system -data_dir = Path("tests", "data") +data_dir = Path(__file__).parents[4] / Path("tests", "data") background_im_dir = os.path.join(data_dir, "background") diff --git a/tests/cellfinder_brainreg/test_unit/test_tools/test_tools_general.py b/tests/cellfinder_brainreg/test_unit/test_tools/test_tools_general.py index 70f7fd55..10fb3c18 100644 --- a/tests/cellfinder_brainreg/test_unit/test_tools/test_tools_general.py +++ b/tests/cellfinder_brainreg/test_unit/test_tools/test_tools_general.py @@ -3,7 +3,7 @@ import numpy as np import pytest -import brainglobe_workflows.tools.tools as tools +import brainglobe_workflows.cellfinder_brainreg.tools.tools as tools a = [1, "a", 10, 30] b = [30, 10, "c", "d"] From 638dc9a816b4cda3cb594169e45792e6a2975d2f Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:35:45 +0000 Subject: [PATCH 07/18] fix utils path --- benchmarks/cellfinder_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/cellfinder_core.py b/benchmarks/cellfinder_core.py index 8b1f6959..8cc7186a 100644 --- a/benchmarks/cellfinder_core.py +++ b/benchmarks/cellfinder_core.py @@ -14,7 +14,7 @@ from brainglobe_workflows.cellfinder_core.cellfinder_core import ( setup as setup_cellfinder_workflow, ) -from brainglobe_workflows.cellfinder_core.utils import ( +from brainglobe_workflows.utils import ( DEFAULT_JSON_CONFIG_PATH_CELLFINDER, ) From 43a4d81640d197bf871fbd28a7e1111bc392d83e Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Thu, 14 Dec 2023 15:40:32 +0000 Subject: [PATCH 08/18] fix path to data dir --- tests/cellfinder_brainreg/test_integration/test_extract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/cellfinder_brainreg/test_integration/test_extract.py b/tests/cellfinder_brainreg/test_integration/test_extract.py index 5c526230..927760f6 100644 --- a/tests/cellfinder_brainreg/test_integration/test_extract.py +++ b/tests/cellfinder_brainreg/test_integration/test_extract.py @@ -1,4 +1,5 @@ import os +from pathlib import Path import imio import numpy as np @@ -15,8 +16,7 @@ extract_cubes as extract_cubes, ) -data_dir = os.path.join("tests", "data") - +data_dir = Path(__file__).parents[3] / Path("tests", "data") signal_data_dir = os.path.join(data_dir, "signal") background_data_dir = os.path.join(data_dir, "background") xml_path = os.path.join(data_dir, "cube_extract", "cells.xml") From ee490059f765f7a92088c1c3453af8a314e3ef23 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:50:54 +0000 Subject: [PATCH 09/18] edit asv to install asv_version of package --- asv.conf.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asv.conf.json b/asv.conf.json index 8ce9490d..f06e89b3 100644 --- a/asv.conf.json +++ b/asv.conf.json @@ -35,7 +35,7 @@ // Customizable commands for installing and uninstalling the project. // See asv.conf.json documentation. - "install_command": ["in-dir={env_dir} python -mpip install --force-reinstall {wheel_file}"], + "install_command": ["in-dir={env_dir} python -mpip install --force-reinstall '{wheel_file}[asv_version]'"], "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"], // List of branches to benchmark. If not provided, defaults to "master" From 06ffe84580df89b805d890c6ae5ed35cfcf4f789 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:56:01 +0000 Subject: [PATCH 10/18] add comments about the dependencies split in the toml --- pyproject.toml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 26060357..abaf009f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ authors = [ ] description = "A collection of end-to-end data analysis workflows executed using BrainGlobe tools." readme = "README.md" -license = { file = "LICENSE" } #{text = "BSD-3-Clause"} +license = { file = "LICENSE" } requires-python = ">=3.9" dynamic = ["version"] @@ -24,6 +24,8 @@ classifiers = [ "Topic :: Scientific/Engineering :: Image Recognition", ] +# Below the dependenciess for the cellfinder CLI tool only +# (i.e., only what users will need for the CLI) dependencies = [ "brainreg>=1.0.0", "cellfinder-core>=0.2.4,<1.0.0", @@ -40,11 +42,12 @@ dependencies = [ "scikit-image", "tifffile", "tqdm", - "asv", - "pooch", + ] [project.optional-dependencies] +# Below, everything developers need to contribute +# to the workflows (i.e., run tests, run benchmarks, etc) dev = [ "black", "pytest-cov", @@ -53,7 +56,19 @@ dev = [ "coverage>=5.0.3", "pre-commit", "setuptools_scm", + "asv", + "pooch", ] +# Below, all the dependencies asv needs to run the benchmarks +# (i.e., everything needed to install this package without the CLI tool) +# Once the cellfinder CLI tool is deprecated, these will move to the +# default dependencies. +asv_version = [ + "asv", + "pooch", + "cellfinder-core", +] + napari = [ "napari[pyqt5]", "brainglobe-napari-io", @@ -67,7 +82,7 @@ napari = [ "Source Code" = "https://github.com/brainglobe/brainglobe-workflows" [project.scripts] -cellfinder-workflow = "brainglobe_workflows.cellfinder:main_app_wrapper" +cellfinder-workflow = "brainglobe_workflows.cellfinder_core:main_app_wrapper" cellfinder = "brainglobe_workflows.cellfinder_brainreg.main:main" [build-system] @@ -80,7 +95,7 @@ zip-safe = false [tool.setuptools.packages.find] include = ["brainglobe_workflows"] -exclude = ["tests", "resources"] +exclude = ["brainglobe_workflows.cellfinder_core","tests", "resources", "benchmarks"] [tool.black] target-version = ["py39", "py310"] From 61909d84f4ee5bb904405bfdc38d8ed2947432f4 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Fri, 15 Dec 2023 13:41:36 +0000 Subject: [PATCH 11/18] update README Co-authored-by: Will Graham <32364977+willGraham01@users.noreply.github.com> --- README.md | 66 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index bdb72d65..82a9b752 100644 --- a/README.md +++ b/README.md @@ -16,27 +16,23 @@ # BrainGlobe Workflows `brainglobe-workflows` is a package that provides users with a number of out-of-the-box data analysis workflows employed in neuroscience, implemented using BrainGlobe tools. + +These workflows represent the most common use-cases and are meant to be easy to reuse. They also serve as an example of how to combine several BrainGlobe tools (possibly together with other tools) to achieve a goal, such as whole brain cell detection and atlas registration. + You can view the [full documentation for each workflow](https://brainglobe.info/documentation/brainglobe-workflows/index.html) online. You can also find the documentation for the backend BrainGlobe tools these workflows use [on our website](https://brainglobe.info/). -At present, the package offers the following workflows: +At present, the package offers the following workflows to users: -- [cellfinder](#cellfinder): Whole-brain detection, registration, and analysis. +- [cellfinder](#cellfinder): a command-line tool for whole-brain detection, registration, and analysis. -These workflows should be representative of the most common use-cases and are meant to be easy to reuse. They also serve as an example of how to combine several BrainGlobe tools to achieve a goal, such as whole brain cell detection and atlas registration. -These workflows typically combine several BrainGlobe tools (possibly together with other tools) to achieve a goal, -such as whole brain cell detection and atlas registration. +Additionally, this repository provides functionalities to support code developers. See [Developers documentation](#developers-documentation) for further details. -## Secondary purposes of brainglobe-workflows, for developers +## Users documentation -We also use these workflows to support code development. We do this by regularly benchmarking the time they take to complete to ensure performance is stable as the code changes. -* Developers can install these benchmarks locally via `pip install .[dev]`. By executing `asv run`, the benchmarks will run with default parameters on a small dataset that is downloaded from [GIN](https://gin.g-node.org/G-Node/info/wiki). See [the asv docs](https://asv.readthedocs.io/en/v0.6.1/using.html#running-benchmarks) for further details on how to run benchmarks. -* Developers can also run these benchmarks on data available locally, by specifying the relevant paths in an input configuration file (JSON file). -* We additionally run and benchmark the workflows locally on a internal desktop machine with large example datasets. These benchmarks are run periodically and the results are made publicly available. -## Installation - -If you want to install BrainGlobe workflows as a standalone tool, you can run `pip install` in your desired environment: +### Installation of the cellfinder CLI tool +At the moment, users can install the cellfinder CLI tool as a standalone tool, by running `pip install` in your desired environment: ```bash pip install brainglobe-workflows @@ -45,24 +41,8 @@ pip install brainglobe-workflows `brainglobe-workflows` is built using BrainGlobe tools, and it will automatically fetch the tools that it needs and install them into your environment. Once BrainGlobe version 1 is available, this package will fetch all BrainGlobe tools and handle their install into your environment, to prevent potential conflicts from partial-installs. -## Contributing - -Contributions to BrainGlobe are more than welcome. -Please see the [developers guide](https://brainglobe.info/developers/index.html). - -## Citing `brainglobe-workflows` - -**If you use any tools in the [brainglobe suite](https://brainglobe.info/documentation/index.html), please [let us know](mailto:code@adamltyson.com?subject=cellfinder), and we'd be happy to promote your paper/talk etc.** - -If you find [`cellfinder`](#cellfinder) useful, and use it in your research, please cite the paper outlining the cell detection algorithm: -> Tyson, A. L., Rousseau, C. V., Niedworok, C. J., Keshavarzi, S., Tsitoura, C., Cossell, L., Strom, M. and Margrie, T. W. (2021) “A deep learning algorithm for 3D cell detection in whole mouse brain image datasets’ PLOS Computational Biology, 17(5), e1009074 -[https://doi.org/10.1371/journal.pcbi.1009074](https://doi.org/10.1371/journal.pcbi.1009074) -> -If you use any of the image registration functions in `cellfinder`, please also cite [`brainreg`](https://github.com/brainglobe/brainreg#citing-brainreg). ---- - -## Cellfinder +### Cellfinder CLI tool Whole-brain cell detection, registration and analysis. @@ -70,7 +50,7 @@ If you want to just use the cell detection part of `cellfinder`, please see the `cellfinder` is a collection of tools developed by [Adam Tyson](https://github.com/adamltyson), [Charly Rousseau](https://github.com/crousseau) and [Christian Niedworok](https://github.com/cniedwor) in the [Margrie Lab](https://www.sainsburywellcome.org/web/groups/margrie-lab), generously supported by the [Sainsbury Wellcome Centre](https://www.sainsburywellcome.org/web/). -`cellfinder` is a designed for the analysis of whole-brain imaging data such as [serial-section imaging](https://sainsburywellcomecentre.github.io/OpenSerialSection/) and lightsheet imaging in cleared tissue. +`cellfinder` is designed for the analysis of whole-brain imaging data such as [serial-section imaging](https://sainsburywellcomecentre.github.io/OpenSerialSection/) and lightsheet imaging in cleared tissue. The aim is to provide a single solution for: - Cell detection (initial cell candidate detection and refinement using deep learning) (using [cellfinder-core](https://github.com/brainglobe/cellfinder-core)), @@ -84,3 +64,27 @@ cellfinder -s signal_images -b background_images -o output_dir --metadata metada ``` Full documentation can be found [here](https://brainglobe.info/documentation/cellfinder/index.html). + + +## Developers documentation + +This repository also includes workflow scripts that are benchmarked to support code development. We regularly benchmark the time the workflows take to complete to ensure performance is stable as the code changes. +* Developers can install these benchmarks locally via `pip install .[dev]`. By executing `asv run`, the benchmarks will run with default parameters on a small dataset that is downloaded from [GIN](https://gin.g-node.org/G-Node/info/wiki). See [the asv docs](https://asv.readthedocs.io/en/v0.6.1/using.html#running-benchmarks) for further details on how to run benchmarks. +* Developers can also run these benchmarks on data available locally, by specifying the relevant paths in an input configuration JSON file. +* We additionally run and benchmark the workflows locally on a internal desktop machine using large example datasets. These benchmarks are run periodically and the results are made publicly available. + +Contributions to BrainGlobe are more than welcome. +Please see the [developers guide](https://brainglobe.info/developers/index.html). + + +## Citing `brainglobe-workflows` + +**If you use any tools in the [brainglobe suite](https://brainglobe.info/documentation/index.html), please [let us know](mailto:code@adamltyson.com?subject=cellfinder), and we'd be happy to promote your paper/talk etc.** + +If you find [`cellfinder`](#cellfinder) useful, and use it in your research, please cite the paper outlining the cell detection algorithm: +> Tyson, A. L., Rousseau, C. V., Niedworok, C. J., Keshavarzi, S., Tsitoura, C., Cossell, L., Strom, M. and Margrie, T. W. (2021) “A deep learning algorithm for 3D cell detection in whole mouse brain image datasets’ PLOS Computational Biology, 17(5), e1009074 +[https://doi.org/10.1371/journal.pcbi.1009074](https://doi.org/10.1371/journal.pcbi.1009074) +> +If you use any of the image registration functions in `cellfinder`, please also cite [`brainreg`](https://github.com/brainglobe/brainreg#citing-brainreg). + +--- From be8dbe1caa8ea93a40dd886d422edc95e2b5b49a Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Fri, 15 Dec 2023 15:26:08 +0000 Subject: [PATCH 12/18] integrate pyproject.toml and tox.ini --- pyproject.toml | 17 ++++++++++++++--- tox.ini | 24 ------------------------ 2 files changed, 14 insertions(+), 27 deletions(-) delete mode 100644 tox.ini diff --git a/pyproject.toml b/pyproject.toml index abaf009f..daa9acdd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,6 +42,7 @@ dependencies = [ "scikit-image", "tifffile", "tqdm", + # "asv" #----- needed for tox! combine pyproject.toml and tox.ini ] @@ -128,18 +129,28 @@ fix = true [tool.tox] legacy_tox_ini = """ [tox] -envlist = py{38,39,310} +envlist = py{39,310}-{coredev} isolated_build = True [gh-actions] python = - 3.8: py38 3.9: py39 3.10: py310 +[gh-actions:env] +# This runs the coredev environment if the "coredev" github actions input +# is set to "true" +INPUT_COREDEV = + true: coredev + [testenv] extras = dev +deps = + coredev: git+https://github.com/brainglobe/cellfinder-core.git commands = - pytest -v --color=yes --cov=brainglobe_workflows --cov-report=xml + pytest {toxinidir} -v --color=yes --cov=./ --cov-report=xml +description = + Run tests + coredev: Run tests with the development version of cellfinder-core """ diff --git a/tox.ini b/tox.ini deleted file mode 100644 index d34ad63e..00000000 --- a/tox.ini +++ /dev/null @@ -1,24 +0,0 @@ -# For more information about tox, see https://tox.readthedocs.io/en/latest/ -[tox] -envlist = py{39,310}-{coredev} - -[gh-actions] -python = - 3.9: py39 - 3.10: py310 - -[gh-actions:env] -# This runs the coredev environment if the "coredev" github actions input -# is set to "true" -INPUT_COREDEV = - true: coredev - -[testenv] -commands = pytest {toxinidir} -v --cov=./ --cov-report=xml -deps = - pytest-cov - pytest - coredev: git+https://github.com/brainglobe/cellfinder-core.git -description = - Run tests - coredev: Run tests with the development version of cellfinder-core From 1ab9ded69d894dc335c360c32db8072f60ad2f54 Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Fri, 15 Dec 2023 16:03:28 +0000 Subject: [PATCH 13/18] fix path to default config --- brainglobe_workflows/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brainglobe_workflows/utils.py b/brainglobe_workflows/utils.py index 717ca7e9..4b3bdac3 100644 --- a/brainglobe_workflows/utils.py +++ b/brainglobe_workflows/utils.py @@ -4,7 +4,7 @@ from pathlib import Path from typing import List -DEFAULT_JSON_CONFIGS_PATH = Path(__file__).resolve().parents[1] / "configs" +DEFAULT_JSON_CONFIGS_PATH = Path(__file__).resolve().parent / "configs" DEFAULT_JSON_CONFIG_PATH_CELLFINDER = ( DEFAULT_JSON_CONFIGS_PATH / "cellfinder.json" From 0f081c3f4ca55f939f587d648abb02284c5b18ce Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Fri, 15 Dec 2023 16:09:00 +0000 Subject: [PATCH 14/18] fix script path in tests --- tests/cellfinder_core/test_integration/test_cellfinder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/cellfinder_core/test_integration/test_cellfinder.py b/tests/cellfinder_core/test_integration/test_cellfinder.py index ae4798fc..38063ddb 100644 --- a/tests/cellfinder_core/test_integration/test_cellfinder.py +++ b/tests/cellfinder_core/test_integration/test_cellfinder.py @@ -86,7 +86,8 @@ def test_script( script_path = ( Path(__file__).resolve().parents[3] / "brainglobe_workflows" - / "cellfinder.py" + / "cellfinder_core" + / "cellfinder_core.py" ) subprocess_input = [ sys.executable, From f3414e9f6314f35c0bbca1c433101029b4ab196b Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Fri, 15 Dec 2023 16:09:20 +0000 Subject: [PATCH 15/18] fix entry point path --- pyproject.toml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index daa9acdd..f7ce8d62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,8 +42,6 @@ dependencies = [ "scikit-image", "tifffile", "tqdm", - # "asv" #----- needed for tox! combine pyproject.toml and tox.ini - ] [project.optional-dependencies] @@ -83,7 +81,7 @@ napari = [ "Source Code" = "https://github.com/brainglobe/brainglobe-workflows" [project.scripts] -cellfinder-workflow = "brainglobe_workflows.cellfinder_core:main_app_wrapper" +cellfinder-workflow = "brainglobe_workflows.cellfinder_core.cellfinder_core:main_app_wrapper" cellfinder = "brainglobe_workflows.cellfinder_brainreg.main:main" [build-system] @@ -96,7 +94,7 @@ zip-safe = false [tool.setuptools.packages.find] include = ["brainglobe_workflows"] -exclude = ["brainglobe_workflows.cellfinder_core","tests", "resources", "benchmarks"] +exclude = ["brainglobe_workflows.cellfinder_core","tests", "resources", "benchmarks"] # it's not excluding "brainglobe_workflows.cellfinder_core"! [tool.black] target-version = ["py39", "py310"] From 582e0e5d68ddf1cec95faa68d9a67a45ef3535a9 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 16/18] 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 From bf1987483010964345d03a2ca94ede6c901558ef Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Sat, 16 Dec 2023 13:49:50 +0000 Subject: [PATCH 17/18] edit skip reason for benchmark tests --- tests/benchmarks/test_cellfinder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/benchmarks/test_cellfinder.py b/tests/benchmarks/test_cellfinder.py index 44d031cc..c323aed0 100644 --- a/tests/benchmarks/test_cellfinder.py +++ b/tests/benchmarks/test_cellfinder.py @@ -53,7 +53,7 @@ def asv_config_monkeypatched_path(tmp_path: Path) -> str: return str(asv_monkeypatched_path) -@pytest.mark.skip(reason="will be worked on a separate PR") +@pytest.mark.skip(reason="focus of PR32") def test_run_benchmarks(asv_config_monkeypatched_path): # --- ideally monkeypatch an asv config so that results are in tmp_dir? From 9c192375d7e71fcbcec66e7094cec650deba10eb Mon Sep 17 00:00:00 2001 From: sfmig <33267254+sfmig@users.noreply.github.com> Date: Wed, 20 Dec 2023 10:53:31 +0000 Subject: [PATCH 18/18] Apply suggestions from code review Co-authored-by: Will Graham <32364977+willGraham01@users.noreply.github.com> --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 82a9b752..678346f4 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ At present, the package offers the following workflows to users: Additionally, this repository provides functionalities to support code developers. See [Developers documentation](#developers-documentation) for further details. -## Users documentation +## User documentation ### Installation of the cellfinder CLI tool @@ -42,7 +42,7 @@ pip install brainglobe-workflows Once BrainGlobe version 1 is available, this package will fetch all BrainGlobe tools and handle their install into your environment, to prevent potential conflicts from partial-installs. -### Cellfinder CLI tool +### Cellfinder Command Line Interface (CLI) Whole-brain cell detection, registration and analysis. @@ -66,15 +66,16 @@ cellfinder -s signal_images -b background_images -o output_dir --metadata metada Full documentation can be found [here](https://brainglobe.info/documentation/cellfinder/index.html). -## Developers documentation +## Developer documentation -This repository also includes workflow scripts that are benchmarked to support code development. We regularly benchmark the time the workflows take to complete to ensure performance is stable as the code changes. -* Developers can install these benchmarks locally via `pip install .[dev]`. By executing `asv run`, the benchmarks will run with default parameters on a small dataset that is downloaded from [GIN](https://gin.g-node.org/G-Node/info/wiki). See [the asv docs](https://asv.readthedocs.io/en/v0.6.1/using.html#running-benchmarks) for further details on how to run benchmarks. -* Developers can also run these benchmarks on data available locally, by specifying the relevant paths in an input configuration JSON file. -* We additionally run and benchmark the workflows locally on a internal desktop machine using large example datasets. These benchmarks are run periodically and the results are made publicly available. +This repository also includes workflow scripts that are benchmarked to support code development. +These benchmarks are run regularly to ensure performance is stable, as the tools are developed and extended. +* Developers can install these benchmarks locally via `pip install .[dev]`. By executing `asv run`, the benchmarks will run with default parameters on a small dataset that is downloaded from [GIN](https://gin.g-node.org/G-Node/info/wiki). See [the asv docs](https://asv.readthedocs.io/en/v0.6.1/using.html#running-benchmarks) for further details on how to run benchmarks. +* Developers can also run these benchmarks on data they have stored locally, by specifying the relevant paths in an input (JSON) file. +* We also maintain an internal runner that benchmarks the workflows over a large, exemplar dataset, of the scale we expect users to be handling. The result of these benchmarks are made publicly available. Contributions to BrainGlobe are more than welcome. -Please see the [developers guide](https://brainglobe.info/developers/index.html). +Please see the [developer guide](https://brainglobe.info/developers/index.html). ## Citing `brainglobe-workflows`