Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetretto committed Jan 15, 2025
1 parent b146019 commit 4cc2bd7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/jobflow_remote/cli/gui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from typing import Annotated, Optional

import typer

from jobflow_remote.cli.jf import app


Expand All @@ -19,4 +20,5 @@ def gui(
Start the server for the GUI
"""
from jobflow_remote.webgui.webgui import start_gui

start_gui(port=port)
12 changes: 9 additions & 3 deletions src/jobflow_remote/webgui/webgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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__":
Expand Down
7 changes: 5 additions & 2 deletions tests/db/jobs/test_jobcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4cc2bd7

Please sign in to comment.