Skip to content

Commit

Permalink
Remove entry point for cellfinder workflow (#93)
Browse files Browse the repository at this point in the history
* remove entry point for cellfinder workflow

* make black happy

* remove entry point test

* remove unused import
  • Loading branch information
sfmig authored Apr 23, 2024
1 parent 625e329 commit 0fd2e4f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 37 deletions.
19 changes: 2 additions & 17 deletions brainglobe_workflows/cellfinder_core/cellfinder_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,27 +437,12 @@ def main(
return cfg


def main_app_wrapper():
"""Parse command line arguments and
run cellfinder setup and workflow
This function is used to define an entry-point,
that allows the user to run the cellfinder workflow
for a given input config file as:
`cellfinder-workflow --config <path-to-input-config>`.
If no input config file is provided, the default is used.
"""
if __name__ == "__main__":
# parse CLI arguments
args = config_parser(
sys.argv[1:], # sys.argv[0] is the script name
sys.argv[1:],
str(DEFAULT_JSON_CONFIG_PATH_CELLFINDER),
)

# run setup and workflow
_ = main(args.config)


if __name__ == "__main__":
main_app_wrapper()
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ napari = ["napari[pyqt5]", "brainglobe-napari-io", "cellfinder[napari]>=1.0.0"]
"Source Code" = "https://github.com/brainglobe/brainglobe-workflows"

[project.scripts]
cellfinder-workflow = "brainglobe_workflows.cellfinder_core.cellfinder_core:main_app_wrapper"
brainmapper = "brainglobe_workflows.brainmapper.main:main"

[build-system]
Expand Down
19 changes: 0 additions & 19 deletions tests/cellfinder_core/test_integration/test_cellfinder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import subprocess
from pathlib import Path
from typing import Optional

Expand Down Expand Up @@ -50,21 +49,3 @@ def test_main_w_inputs(

# check output files exist
assert Path(cfg._detected_cells_path).is_file()


def test_entry_point_help():
"""
Smoke test the cellfinder workflow entry point by checking
help is printed out successfully
"""

# define CLI input
subprocess_input = ["cellfinder-workflow", "--help"]

# run workflow
subprocess_output = subprocess.run(
subprocess_input,
)

# check returncode
assert subprocess_output.returncode == 0

0 comments on commit 0fd2e4f

Please sign in to comment.