diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 8ff93c6..9cef8ec 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.10 - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: "3.10" - name: Install dependencies diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 7598b25..06846b8 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -18,11 +18,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.10 - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - name: Set up Python 3.13 + uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.13" - name: Install dependencies run: | sudo apt update @@ -40,7 +40,7 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Lint with pylint run: | - pylint ./src/dear_ros_node_viewer --disable=E0401 + pylint ./src/dear_ros_node_viewer --disable=E0401,W1203,C0301 - name: Test with pytest run: | pytest --doctest-modules -v --cov=./src/dear_ros_node_viewer diff --git a/src/dear_ros_node_viewer/dot2networkx.py b/src/dear_ros_node_viewer/dot2networkx.py index 1c90836..ac3823d 100644 --- a/src/dear_ros_node_viewer/dot2networkx.py +++ b/src/dear_ros_node_viewer/dot2networkx.py @@ -28,7 +28,7 @@ def dot2networkx_nodeonly(graph_org: nx.classes.digraph.DiGraph, ignore_unconnected=True) -> nx.classes.digraph.DiGraph: """Create NetworkX Object from dot graph file (nodes only) by rqt_graph""" - graph = nx.DiGraph() + graph = nx.MultiDiGraph() for node_org in graph_org.nodes: if 'label' not in graph_org.nodes[node_org]: continue @@ -82,7 +82,7 @@ def dot2networkx_nodetopic(graph_org: nx.classes.digraph.DiGraph) -> nx.classes. def dot2networkx(filename: str, ignore_unconnected=True) -> nx.classes.digraph.DiGraph: """Function to create NetworkX object from dot graph file (rosgraph.dot)""" - graph_org = nx.DiGraph(nx.nx_pydot.read_dot(filename)) + graph_org = nx.MultiDiGraph(nx.nx_pydot.read_dot(filename)) is_node_only = True for node_org in graph_org.nodes: diff --git a/src/dear_ros_node_viewer/graph_layout.py b/src/dear_ros_node_viewer/graph_layout.py index 9bd1bd6..3871f3b 100644 --- a/src/dear_ros_node_viewer/graph_layout.py +++ b/src/dear_ros_node_viewer/graph_layout.py @@ -94,7 +94,7 @@ def place_node(graph: nx.classes.digraph.DiGraph, group_name: str, prog: str = ' Dictionary of normalized positions keyed by node. """ - graph_modified = nx.DiGraph() + graph_modified = nx.MultiDiGraph() for node_name in graph.nodes: if group_name in node_name: graph_modified.add_node(node_name) diff --git a/src/dear_ros_node_viewer/graph_manager.py b/src/dear_ros_node_viewer/graph_manager.py index 9c6bba6..97fc910 100644 --- a/src/dear_ros_node_viewer/graph_manager.py +++ b/src/dear_ros_node_viewer/graph_manager.py @@ -33,7 +33,7 @@ def __init__(self, app_setting, group_setting): self.app_setting = app_setting self.group_setting = group_setting self.dir = './' - self.graph: nx.DiGraph = nx.DiGraph() + self.graph: nx.DiGraph = nx.MultiDiGraph() self.caret_path_dict: dict = {} def load_graph_from_caret(self, filename: str, target_path: str = 'all_graph'): diff --git a/src/dear_ros_node_viewer/graph_view.py b/src/dear_ros_node_viewer/graph_view.py index 035d672..ac7bd73 100644 --- a/src/dear_ros_node_viewer/graph_view.py +++ b/src/dear_ros_node_viewer/graph_view.py @@ -367,7 +367,7 @@ def _make_font_table(self, font_path): if __name__ == '__main__': def local_main(): """main function for this file""" - graph = nx.DiGraph() + graph = nx.MultiDiGraph() nx.add_path(graph, ['3', '5', '4', '1', '0', '2']) nx.add_path(graph, ['3', '0', '4', '2', '1', '5']) layout = nx.spring_layout(graph) diff --git a/tests/test_graph_layout.py b/tests/test_graph_layout.py index 1e21a33..03200d0 100644 --- a/tests/test_graph_layout.py +++ b/tests/test_graph_layout.py @@ -20,7 +20,7 @@ def test_graph_layout(): - graph = nx.DiGraph() + graph = nx.MultiDiGraph() nx.add_path(graph, ['"/3"', '"/5"', '"/4"', '"/1"', '"/0"', '"/2"']) group_setting = {