|
255 | 255 | }, |
256 | 256 | { |
257 | 257 | "cell_type": "code", |
258 | | - "execution_count": 27, |
| 258 | + "execution_count": 4, |
259 | 259 | "metadata": {}, |
260 | 260 | "outputs": [ |
261 | 261 | { |
|
267 | 267 | "<!-- Generated by graphviz version 8.0.2 (20230410.1723)\n", |
268 | 268 | " -->\n", |
269 | 269 | "<!-- Title: root Pages: 1 -->\n", |
270 | | - "<svg width=\"167pt\" height=\"153pt\"\n", |
271 | | - " viewBox=\"0.00 0.00 167.39 153.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", |
272 | | - "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 149)\">\n", |
| 270 | + "<svg width=\"418pt\" height=\"44pt\"\n", |
| 271 | + " viewBox=\"0.00 0.00 418.37 44.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", |
| 272 | + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 40)\">\n", |
273 | 273 | "<title>root</title>\n", |
274 | | - "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-149 163.39,-149 163.39,4 -4,4\"/>\n", |
275 | | - "<g id=\"clust1\" class=\"cluster\">\n", |
276 | | - "<title>cluster_0</title>\n", |
277 | | - "<polygon fill=\"none\" stroke=\"black\" points=\"8,-8 8,-137 151.39,-137 151.39,-8 8,-8\"/>\n", |
278 | | - "<text text-anchor=\"middle\" x=\"79.69\" y=\"-121.8\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">MyFolder</text>\n", |
279 | | - "</g>\n", |
280 | | - "<!-- MyFolder/MyFirstJob -->\n", |
| 274 | + "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-40 414.37,-40 414.37,4 -4,4\"/>\n", |
| 275 | + "<!-- my-folder/sub-folder-1 -->\n", |
281 | 276 | "<g id=\"node1\" class=\"node\">\n", |
282 | | - "<title>MyFolder/MyFirstJob</title>\n", |
283 | | - "<ellipse fill=\"none\" stroke=\"black\" cx=\"79.69\" cy=\"-88\" rx=\"52.79\" ry=\"18\"/>\n", |
284 | | - "<text text-anchor=\"middle\" x=\"79.69\" y=\"-84.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">MyFirstJob</text>\n", |
| 277 | + "<title>my-folder/sub-folder-1</title>\n", |
| 278 | + "<ellipse fill=\"none\" stroke=\"black\" cx=\"93.59\" cy=\"-18\" rx=\"93.68\" ry=\"18\"/>\n", |
| 279 | + "<text text-anchor=\"middle\" x=\"93.59\" y=\"-14.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">my-folder/sub-folder-1</text>\n", |
285 | 280 | "</g>\n", |
286 | | - "<!-- MyFolder/MySecondJob -->\n", |
| 281 | + "<!-- my-folder/sub-folder-2 -->\n", |
287 | 282 | "<g id=\"node2\" class=\"node\">\n", |
288 | | - "<title>MyFolder/MySecondJob</title>\n", |
289 | | - "<ellipse fill=\"none\" stroke=\"black\" cx=\"79.69\" cy=\"-34\" rx=\"63.89\" ry=\"18\"/>\n", |
290 | | - "<text text-anchor=\"middle\" x=\"79.69\" y=\"-30.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">MySecondJob</text>\n", |
| 283 | + "<title>my-folder/sub-folder-2</title>\n", |
| 284 | + "<ellipse fill=\"none\" stroke=\"black\" cx=\"316.78\" cy=\"-18\" rx=\"93.68\" ry=\"18\"/>\n", |
| 285 | + "<text text-anchor=\"middle\" x=\"316.78\" y=\"-14.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">my-folder/sub-folder-2</text>\n", |
| 286 | + "</g>\n", |
| 287 | + "<!-- my-folder/sub-folder-1->my-folder/sub-folder-2 -->\n", |
| 288 | + "<g id=\"edge1\" class=\"edge\">\n", |
| 289 | + "<title>my-folder/sub-folder-1->my-folder/sub-folder-2</title>\n", |
| 290 | + "<path fill=\"none\" stroke=\"black\" d=\"M187.75,-18C195.71,-18 203.78,-18 211.82,-18\"/>\n", |
| 291 | + "<polygon fill=\"black\" stroke=\"black\" points=\"211.72,-21.5 221.72,-18 211.72,-14.5 211.72,-21.5\"/>\n", |
291 | 292 | "</g>\n", |
292 | 293 | "</g>\n", |
293 | 294 | "</svg>\n" |
294 | 295 | ], |
295 | 296 | "text/plain": [ |
296 | | - "<graphviz.graphs.Digraph at 0x28d6ba39e20>" |
| 297 | + "<graphviz.graphs.Digraph at 0x28ca7a3d010>" |
297 | 298 | ] |
298 | 299 | }, |
299 | | - "execution_count": 27, |
| 300 | + "execution_count": 4, |
300 | 301 | "metadata": {}, |
301 | 302 | "output_type": "execute_result" |
302 | 303 | } |
|
398 | 399 | "get_graph(workflow)" |
399 | 400 | ] |
400 | 401 | }, |
| 402 | + { |
| 403 | + "cell_type": "markdown", |
| 404 | + "metadata": {}, |
| 405 | + "source": [ |
| 406 | + "### Connecting two SubFolders" |
| 407 | + ] |
| 408 | + }, |
| 409 | + { |
| 410 | + "cell_type": "markdown", |
| 411 | + "metadata": {}, |
| 412 | + "source": [ |
| 413 | + "You can also connect SubFolders, not just Jobs or Folders.\n", |
| 414 | + "To do this, use workflow.connect(src, dest, inpath=...) where src and dest are the names of the SubFolders (as strings), and inpath is the name of the parent Folder that contains them." |
| 415 | + ] |
| 416 | + }, |
| 417 | + { |
| 418 | + "cell_type": "code", |
| 419 | + "execution_count": null, |
| 420 | + "metadata": {}, |
| 421 | + "outputs": [ |
| 422 | + { |
| 423 | + "data": { |
| 424 | + "image/svg+xml": [ |
| 425 | + "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n", |
| 426 | + "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n", |
| 427 | + " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n", |
| 428 | + "<!-- Generated by graphviz version 8.0.2 (20230410.1723)\n", |
| 429 | + " -->\n", |
| 430 | + "<!-- Title: root Pages: 1 -->\n", |
| 431 | + "<svg width=\"418pt\" height=\"44pt\"\n", |
| 432 | + " viewBox=\"0.00 0.00 418.37 44.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", |
| 433 | + "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 40)\">\n", |
| 434 | + "<title>root</title>\n", |
| 435 | + "<polygon fill=\"white\" stroke=\"none\" points=\"-4,4 -4,-40 414.37,-40 414.37,4 -4,4\"/>\n", |
| 436 | + "<!-- my-folder/sub-folder-1 -->\n", |
| 437 | + "<g id=\"node1\" class=\"node\">\n", |
| 438 | + "<title>my-folder/sub-folder-1</title>\n", |
| 439 | + "<ellipse fill=\"none\" stroke=\"black\" cx=\"93.59\" cy=\"-18\" rx=\"93.68\" ry=\"18\"/>\n", |
| 440 | + "<text text-anchor=\"middle\" x=\"93.59\" y=\"-14.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">my-folder/sub-folder-1</text>\n", |
| 441 | + "</g>\n", |
| 442 | + "<!-- my-folder/sub-folder-2 -->\n", |
| 443 | + "<g id=\"node2\" class=\"node\">\n", |
| 444 | + "<title>my-folder/sub-folder-2</title>\n", |
| 445 | + "<ellipse fill=\"none\" stroke=\"black\" cx=\"316.78\" cy=\"-18\" rx=\"93.68\" ry=\"18\"/>\n", |
| 446 | + "<text text-anchor=\"middle\" x=\"316.78\" y=\"-14.3\" font-family=\"Times New Roman,serif\" font-size=\"14.00\">my-folder/sub-folder-2</text>\n", |
| 447 | + "</g>\n", |
| 448 | + "<!-- my-folder/sub-folder-1->my-folder/sub-folder-2 -->\n", |
| 449 | + "<g id=\"edge1\" class=\"edge\">\n", |
| 450 | + "<title>my-folder/sub-folder-1->my-folder/sub-folder-2</title>\n", |
| 451 | + "<path fill=\"none\" stroke=\"black\" d=\"M187.75,-18C195.71,-18 203.78,-18 211.82,-18\"/>\n", |
| 452 | + "<polygon fill=\"black\" stroke=\"black\" points=\"211.72,-21.5 221.72,-18 211.72,-14.5 211.72,-21.5\"/>\n", |
| 453 | + "</g>\n", |
| 454 | + "</g>\n", |
| 455 | + "</svg>\n" |
| 456 | + ], |
| 457 | + "text/plain": [ |
| 458 | + "<graphviz.graphs.Digraph at 0x28ca7aca990>" |
| 459 | + ] |
| 460 | + }, |
| 461 | + "execution_count": 5, |
| 462 | + "metadata": {}, |
| 463 | + "output_type": "execute_result" |
| 464 | + } |
| 465 | + ], |
| 466 | + "source": [ |
| 467 | + "workflow.clear_all()\n", |
| 468 | + "\n", |
| 469 | + "#FOLDER\n", |
| 470 | + "folder = Folder(\"my-folder\")\n", |
| 471 | + "\n", |
| 472 | + "#Subfolders\n", |
| 473 | + "subFolder1 = SubFolder(\"sub-folder-1\")\n", |
| 474 | + "folder.sub_folder_list.append(subFolder1)\n", |
| 475 | + "subFolder2 = SubFolder(\"sub-folder-2\")\n", |
| 476 | + "folder.sub_folder_list.append(subFolder2)\n", |
| 477 | + "\n", |
| 478 | + "workflow.add(folder)\n", |
| 479 | + "workflow.connect(\"sub-folder-1\", \"sub-folder-2\",inpath=\"my-folder\")\n", |
| 480 | + "\n", |
| 481 | + "get_graph(workflow)" |
| 482 | + ] |
| 483 | + }, |
401 | 484 | { |
402 | 485 | "cell_type": "markdown", |
403 | 486 | "metadata": {}, |
|
834 | 917 | ], |
835 | 918 | "metadata": { |
836 | 919 | "kernelspec": { |
837 | | - "display_name": "Python 3.10.4 ('venv': venv)", |
| 920 | + "display_name": "venv", |
838 | 921 | "language": "python", |
839 | 922 | "name": "python3" |
840 | 923 | }, |
|
848 | 931 | "name": "python", |
849 | 932 | "nbconvert_exporter": "python", |
850 | 933 | "pygments_lexer": "ipython3", |
851 | | - "version": "3.8.9" |
| 934 | + "version": "3.12.6" |
852 | 935 | }, |
853 | | - "orig_nbformat": 4, |
854 | | - "vscode": { |
855 | | - "interpreter": { |
856 | | - "hash": "e36608863334e111ac1975278d851976534d4d97e80edd449207481e04c86242" |
857 | | - } |
858 | | - } |
| 936 | + "orig_nbformat": 4 |
859 | 937 | }, |
860 | 938 | "nbformat": 4, |
861 | 939 | "nbformat_minor": 2 |
|
0 commit comments