Skip to content

Commit

Permalink
fix notebook.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianmurariu committed Jul 24, 2024
1 parent 2fbe431 commit 32b2eee
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions python/tests/notebook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 32b2eee

Please sign in to comment.