Skip to content

Commit 2808440

Browse files
slancer50shacharl
andauthored
docs: add documentation for connecting SubFolders in a Workflow (#129)
Co-authored-by: shacharl <shachar_lancer@bmc.il>
1 parent 22f92c2 commit 2808440

30 files changed

+11346
-8896
lines changed

docs/_images/notebooks_hello_19_0.svg

Lines changed: 18 additions & 17 deletions
Loading

docs/_sources/notebooks/hello.ipynb.txt

Lines changed: 106 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
},
256256
{
257257
"cell_type": "code",
258-
"execution_count": 27,
258+
"execution_count": 4,
259259
"metadata": {},
260260
"outputs": [
261261
{
@@ -267,36 +267,37 @@
267267
"<!-- Generated by graphviz version 8.0.2 (20230410.1723)\n",
268268
" -->\n",
269269
"<!-- 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",
273273
"<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&#45;folder/sub&#45;folder&#45;1 -->\n",
281276
"<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&#45;folder/sub&#45;folder&#45;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&#45;folder/sub&#45;folder&#45;1</text>\n",
285280
"</g>\n",
286-
"<!-- MyFolder/MySecondJob -->\n",
281+
"<!-- my&#45;folder/sub&#45;folder&#45;2 -->\n",
287282
"<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&#45;folder/sub&#45;folder&#45;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&#45;folder/sub&#45;folder&#45;2</text>\n",
286+
"</g>\n",
287+
"<!-- my&#45;folder/sub&#45;folder&#45;1&#45;&gt;my&#45;folder/sub&#45;folder&#45;2 -->\n",
288+
"<g id=\"edge1\" class=\"edge\">\n",
289+
"<title>my&#45;folder/sub&#45;folder&#45;1&#45;&gt;my&#45;folder/sub&#45;folder&#45;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",
291292
"</g>\n",
292293
"</g>\n",
293294
"</svg>\n"
294295
],
295296
"text/plain": [
296-
"<graphviz.graphs.Digraph at 0x28d6ba39e20>"
297+
"<graphviz.graphs.Digraph at 0x28ca7a3d010>"
297298
]
298299
},
299-
"execution_count": 27,
300+
"execution_count": 4,
300301
"metadata": {},
301302
"output_type": "execute_result"
302303
}
@@ -398,6 +399,88 @@
398399
"get_graph(workflow)"
399400
]
400401
},
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&#45;folder/sub&#45;folder&#45;1 -->\n",
437+
"<g id=\"node1\" class=\"node\">\n",
438+
"<title>my&#45;folder/sub&#45;folder&#45;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&#45;folder/sub&#45;folder&#45;1</text>\n",
441+
"</g>\n",
442+
"<!-- my&#45;folder/sub&#45;folder&#45;2 -->\n",
443+
"<g id=\"node2\" class=\"node\">\n",
444+
"<title>my&#45;folder/sub&#45;folder&#45;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&#45;folder/sub&#45;folder&#45;2</text>\n",
447+
"</g>\n",
448+
"<!-- my&#45;folder/sub&#45;folder&#45;1&#45;&gt;my&#45;folder/sub&#45;folder&#45;2 -->\n",
449+
"<g id=\"edge1\" class=\"edge\">\n",
450+
"<title>my&#45;folder/sub&#45;folder&#45;1&#45;&gt;my&#45;folder/sub&#45;folder&#45;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+
},
401484
{
402485
"cell_type": "markdown",
403486
"metadata": {},
@@ -834,7 +917,7 @@
834917
],
835918
"metadata": {
836919
"kernelspec": {
837-
"display_name": "Python 3.10.4 ('venv': venv)",
920+
"display_name": "venv",
838921
"language": "python",
839922
"name": "python3"
840923
},
@@ -848,14 +931,9 @@
848931
"name": "python",
849932
"nbconvert_exporter": "python",
850933
"pygments_lexer": "ipython3",
851-
"version": "3.8.9"
934+
"version": "3.12.6"
852935
},
853-
"orig_nbformat": 4,
854-
"vscode": {
855-
"interpreter": {
856-
"hash": "e36608863334e111ac1975278d851976534d4d97e80edd449207481e04c86242"
857-
}
858-
}
936+
"orig_nbformat": 4
859937
},
860938
"nbformat": 4,
861939
"nbformat_minor": 2

docs/_static/basic.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -741,6 +741,14 @@ abbr, acronym {
741741
cursor: help;
742742
}
743743

744+
.translated {
745+
background-color: rgba(207, 255, 207, 0.2)
746+
}
747+
748+
.untranslated {
749+
background-color: rgba(255, 207, 207, 0.2)
750+
}
751+
744752
/* -- code displays --------------------------------------------------------- */
745753

746754
pre {

docs/_static/searchtools.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -513,11 +513,9 @@ const Search = {
513513
// perform the search on the required terms
514514
searchTerms.forEach((word) => {
515515
const files = [];
516-
// find documents, if any, containing the query word in their text/title term indices
517-
// use Object.hasOwnProperty to avoid mismatching against prototype properties
518516
const arr = [
519-
{ files: terms.hasOwnProperty(word) ? terms[word] : undefined, score: Scorer.term },
520-
{ files: titleTerms.hasOwnProperty(word) ? titleTerms[word] : undefined, score: Scorer.title },
517+
{ files: terms[word], score: Scorer.term },
518+
{ files: titleTerms[word], score: Scorer.title },
521519
];
522520
// add support for partial matches
523521
if (word.length > 2) {
@@ -549,9 +547,8 @@ const Search = {
549547

550548
// set score for the word in each file
551549
recordFiles.forEach((file) => {
552-
if (!scoreMap.has(file)) scoreMap.set(file, new Map());
553-
const fileScores = scoreMap.get(file);
554-
fileScores.set(word, record.score);
550+
if (!scoreMap.has(file)) scoreMap.set(file, {});
551+
scoreMap.get(file)[word] = record.score;
555552
});
556553
});
557554

@@ -590,7 +587,7 @@ const Search = {
590587
break;
591588

592589
// select one (max) score for the file.
593-
const score = Math.max(...wordList.map((w) => scoreMap.get(file).get(w)));
590+
const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w]));
594591
// add result to the result list
595592
results.push([
596593
docNames[file],

0 commit comments

Comments
 (0)