diff --git a/src/jobflow_remote/cli/gui.py b/src/jobflow_remote/cli/gui.py index 2d7b2a5c..0fdc5199 100644 --- a/src/jobflow_remote/cli/gui.py +++ b/src/jobflow_remote/cli/gui.py @@ -1,6 +1,7 @@ from typing import Annotated, Optional import typer + from jobflow_remote.cli.jf import app @@ -19,4 +20,5 @@ def gui( Start the server for the GUI """ from jobflow_remote.webgui.webgui import start_gui + start_gui(port=port) diff --git a/src/jobflow_remote/webgui/webgui.py b/src/jobflow_remote/webgui/webgui.py index a100df4c..2159e6d0 100644 --- a/src/jobflow_remote/webgui/webgui.py +++ b/src/jobflow_remote/webgui/webgui.py @@ -3,8 +3,8 @@ from collections import Counter from datetime import datetime, timezone from math import ceil -from zoneinfo import ZoneInfo from pathlib import Path +from zoneinfo import ZoneInfo from monty.dev import requires @@ -1168,9 +1168,15 @@ def post( ), Div(Script(mermaid_js, type="module"), id="dialog-container") -@requires(fasthtml is not None, "The 'python-fasthtml' package is required to run the gui.") +@requires( + fasthtml is not None, "The 'python-fasthtml' package is required to run the gui." +) def start_gui(port: int | None = None): - serve(appname="jobflow_remote.webgui.webgui", port=port, reload_includes=[Path(__file__).parent],) + serve( + appname="jobflow_remote.webgui.webgui", + port=port, + reload_includes=[Path(__file__).parent], + ) if __name__ == "__main__": diff --git a/tests/db/jobs/test_jobcontroller.py b/tests/db/jobs/test_jobcontroller.py index d748c94b..28ec7cd6 100644 --- a/tests/db/jobs/test_jobcontroller.py +++ b/tests/db/jobs/test_jobcontroller.py @@ -124,9 +124,12 @@ def test_queries(job_controller, runner) -> None: ) # test skip - skipped_flows= job_controller.get_flows_info(sort=["updated_on"], skip=1) + skipped_flows = job_controller.get_flows_info(sort=["updated_on"], skip=1) assert len(skipped_flows) == job_controller.count_flows() - 1 - assert skipped_flows[0].updated_on == job_controller.get_flows_info(sort=["updated_on"])[1].updated_on + assert ( + skipped_flows[0].updated_on + == job_controller.get_flows_info(sort=["updated_on"])[1].updated_on + ) def test_rerun_completed(job_controller, runner) -> None: