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

added exit status 255 when no data #316

Merged
merged 1 commit into from
Jul 27, 2023
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
8 changes: 6 additions & 2 deletions src/arctic3d/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ def cli(arguments, main_func):

"""
cmd = load_args(arguments)
main_func(**vars(cmd))
return main_func(**vars(cmd))


def maincli():
"""Execute main client."""
cli(argument_parser, main)
return cli(argument_parser, main)


def main(
Expand Down Expand Up @@ -317,6 +317,10 @@ def main(
f"arctic3d run completed in {(time.time() - st_time):.2f} seconds."
)

# check if there's at least one interface
if Path(run_dir_path, "clustered_interfaces.out").is_file() is False:
return 255


if __name__ == "__main__":
sys.exit(maincli())
4 changes: 3 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def test_cli_empty():
"""Test main cli with uniprot ID with no interfaces."""
target_uniprot = "P23804"
start_cwd = os.getcwd()
main(
exit_code = main(
input_arg=target_uniprot,
db=None,
interface_file=None,
Expand All @@ -25,6 +25,8 @@ def test_cli_empty():
threshold=None,
min_clust_size=None,
)
# assert exit code
assert exit_code == 255
os.chdir(start_cwd)
exp_dir = Path(f"arctic3d-{target_uniprot}")
assert exp_dir.exists() is True
Expand Down