Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove entry point for cellfinder workflow #93

Merged
merged 4 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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