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

Fine tuning for web app purpose #1126

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
20 changes: 14 additions & 6 deletions src/haddock/clis/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def cli(ap: ArgumentParser, main: Callable[..., None]) -> None:

def maincli() -> None:
"""Execute main client."""
cli(ap, main)
cli(_ap(), main)


def main(
Expand Down Expand Up @@ -117,6 +117,7 @@ def main(
get_initial_greeting,
gen_feedback_messages,
)
from haddock.gear.postprocessing import archive_run
from haddock.gear.prepare_run import setup_run
from haddock.libs.libio import working_directory
from haddock.libs.liblog import (
Expand Down Expand Up @@ -181,10 +182,7 @@ def main(
restart_step = restart
WorkflowManager_ = WorkflowManager

with (
working_directory(_run_dir),
log_error_and_exit(),
):
with (working_directory(_run_dir), log_error_and_exit()):
workflow = WorkflowManager_(
workflow_params=params,
start=restart_step,
Expand All @@ -193,10 +191,20 @@ def main(

# Main loop of execution
workflow.run()

# Run post-processing steps
if other_params["postprocess"]:
workflow.postprocess()
workflow.postprocess(self_contained=other_params["gen_archive"])
# Clean outputs
workflow.clean()

# Generate archive of the run
if other_params["gen_archive"]:
_run_archive, _analysis_archive = archive_run(_run_dir)
log.info(f"Run archive created: {_run_archive}!")
if _analysis_archive:
log.info(f"Run analysis archive created: {_analysis_archive}")

# Finish
end = time()
elapsed = convert_seconds_to_min_sec(end - start)
Expand Down
Loading