Skip to content

Commit

Permalink
fix start_dpgui
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz committed Oct 7, 2023
1 parent ad75113 commit 0851f48
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions dpgen/gui.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""DP-GUI entrypoint."""
import argparse

Check warning on line 3 in dpgen/gui.py

View check run for this annotation

Codecov / codecov/patch

dpgen/gui.py#L2-L3

Added lines #L2 - L3 were not covered by tests


def start_dpgui(*, port: int, bind_all: bool, **kwargs):
def start_dpgui(args: argparse.Namespace):

Check warning on line 6 in dpgen/gui.py

View check run for this annotation

Codecov / codecov/patch

dpgen/gui.py#L6

Added line #L6 was not covered by tests
"""Host DP-GUI server.
Parameters
----------
port : int
The port to serve DP-GUI on.
bind_all : bool
Serve on all public interfaces. This will expose your DP-GUI instance
to the network on both IPv4 and IPv6 (where available).
**kwargs
additional arguments
args : argparse.Namespace
Arguments from argparse.
Raises
------
Expand All @@ -28,4 +24,4 @@ def start_dpgui(*, port: int, bind_all: bool, **kwargs):
raise ModuleNotFoundError(

Check warning on line 24 in dpgen/gui.py

View check run for this annotation

Codecov / codecov/patch

dpgen/gui.py#L23-L24

Added lines #L23 - L24 were not covered by tests
"To use DP-GUI, please install the dpgui package:\npip install dpgui"
) from e
start_dpgui(port=port, bind_all=bind_all)
start_dpgui(port=args.port, bind_all=args.bind_all)

Check warning on line 27 in dpgen/gui.py

View check run for this annotation

Codecov / codecov/patch

dpgen/gui.py#L27

Added line #L27 was not covered by tests

0 comments on commit 0851f48

Please sign in to comment.