From 32b2eeea28e8793db16d208d968e5c098c7d48e3 Mon Sep 17 00:00:00 2001 From: Fabian Murariu Date: Wed, 24 Jul 2024 09:45:51 +0100 Subject: [PATCH] fix notebook.ipynb --- python/tests/notebook.ipynb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/python/tests/notebook.ipynb b/python/tests/notebook.ipynb index e11946767e..d40a7f60e4 100644 --- a/python/tests/notebook.ipynb +++ b/python/tests/notebook.ipynb @@ -67,9 +67,9 @@ } ], "source": [ - "g.add_edge(0, 1, 2)\n", - "g.add_edge(0, 1, 3, layer=\"layer1\")\n", - "g.add_edge(0, 1, 4, layer=\"layer2\")\n", + "g.add_edge(0, \"1\", \"2\")\n", + "g.add_edge(0, \"1\", \"3\", layer=\"layer1\")\n", + "g.add_edge(0, \"1\", \"4\", layer=\"layer2\")\n", "\n", "g.nodes.edges.layer_names" ] @@ -116,14 +116,14 @@ } ], "source": [ - "# Basic Addition with integer IDs\n", - "g.add_node(timestamp=1, id=10)\n", - "g.add_edge(timestamp=2, src=1, dst=2)\n", + "# Basic Addition of Nodes and Edges\n", + "g.add_node(timestamp=1, id=\"10\")\n", + "g.add_edge(timestamp=2, src=\"1\", dst=\"2\")\n", "\n", "# checking node 10, 1 and 5 exist\n", - "print(g.has_node(10), g.has_node(1), g.has_node(5))\n", + "print(g.has_node(\"10\"), g.has_node(\"1\"), g.has_node(\"5\"))\n", "# checking edge 1,2 exists and 2,1 doesn't as Raphtory is directed\n", - "print(g.has_edge(1, 2), g.has_edge(2, 1))\n", + "print(g.has_edge(\"1\", \"2\"), g.has_edge(\"2\", \"1\"))\n", "# Check the total number of edges and nodes\n", "print(g.count_edges(), g.count_nodes())\n", "\n", @@ -136,7 +136,7 @@ "print(g.has_edge(src=\"Hamza\", dst=\"Ben\"), g.has_edge(src=\"Ben\", dst=\"Hamza\"))\n", "print(g.count_edges(), g.count_nodes())\n", "\n", - "g.add_edge(0, 1, 3, layer=\"toad\")\n", + "g.add_edge(0, \"1\", \"3\", layer=\"toad\")\n", "# Add an edge with Temporal Properties which can change over time\n", "e = g.add_edge(\n", " timestamp=7,\n",