File tree 6 files changed +27
-12
lines changed
6 files changed +27
-12
lines changed Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ pip install notebooks-and-scripts
17
17
To use on [ AWS SageMaker] ( https://aws.amazon.com/sagemaker/ ) replace ` <plugin-name> ` with ` nbs ` and follow [ these instructions] ( https://github.com/kamangir/notebooks-and-scripts/blob/main/SageMaker.md ) .
18
18
19
19
---
20
- built by [ ` abcli-9.192.1-current ` ] ( https://github.com/kamangir/awesome-bash-cli ) , based on [ ` notebooks_and_scripts-4.645 .1 ` ] ( https://github.com/kamangir/notebooks-and-scripts ) .
20
+ built by [ ` abcli-9.192.1-current ` ] ( https://github.com/kamangir/awesome-bash-cli ) , based on [ ` notebooks_and_scripts-4.649 .1 ` ] ( https://github.com/kamangir/notebooks-and-scripts ) .
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ function notebooks_and_scripts_workflow_monitor() {
4
4
local options=$1
5
5
6
6
if [ $( abcli_option_int " $options " help 0) == 1 ]; then
7
- local options=" $EOP ~download,node=<node>,publish_as=<public-object-name>,~upload"
8
- abcli_show_usage " workflow monitor$ABCUL$options$ABCUL .|<job-name>$EOPE " \
9
- " monitor workflow."
7
+ local options=" ~download,node=<node>,publish_as=<public-object-name>,~upload"
8
+ abcli_show_usage " workflow monitor$ABCUL$EOP [ $ options] $ABCUL [ .|<job-name>] $ABCUL [<command-line>] $EOPE " \
9
+ " monitor <job-name>/ workflow and run <command-line> ."
10
10
return
11
11
fi
12
12
@@ -33,5 +33,11 @@ function notebooks_and_scripts_workflow_monitor() {
33
33
[[ ! -z " $publish_as " ]] &&
34
34
abcli_publish as=$publish_as ,~download,suffix=.gif $job_name
35
35
36
- return 0
36
+ local command_line=" ${@: 3} "
37
+ if [[ ! -z " $command_line " ]]; then
38
+ abcli_eval - \
39
+ " $command_line "
40
+ else
41
+ return 0
42
+ fi
37
43
}
Original file line number Diff line number Diff line change 4
4
5
5
DESCRIPTION = f"{ ICON } notebooks and scripts for ai experiments and aws batch jobs."
6
6
7
- VERSION = "4.645 .1"
7
+ VERSION = "4.649 .1"
8
8
9
9
REPO_NAME = "notebooks-and-scripts"
10
10
Original file line number Diff line number Diff line change @@ -24,12 +24,12 @@ example use: [literature review using OpenAI API](https://github.com/kamangir/op
24
24
| | | | |
25
25
| --- | --- | --- | --- |
26
26
| 📜 | [ ` a-bc-d ` ] ( ./patterns/a-bc-d.dot ) | [ ` hourglass ` ] ( ./patterns/hourglass.dot ) | [ ` map-reduce ` ] ( ./patterns/map-reduce.dot ) |
27
- | [ aws_batch] ( ./runners/aws_batch.py ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-a-bc-d/workflow.gif?raw=true )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-a-bc-d/workflow.gif?raw=true ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-hourglass/workflow.gif?raw=true )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-hourglass/workflow.gif?raw=true ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-map-reduce/workflow.gif?raw=true )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-map-reduce/workflow.gif?raw=true ) |
28
- | [ generic] ( ./runners/generic.py ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-a-bc-d/workflow.gif?raw=true )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-a-bc-d/workflow.gif?raw=true ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-hourglass/workflow.gif?raw=true )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-hourglass/workflow.gif?raw=true ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-map-reduce/workflow.gif?raw=true )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-map-reduce/workflow.gif?raw=true ) |
29
- | [ local] ( ./runners/local.py ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-a-bc-d/workflow.gif?raw=true )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-a-bc-d/workflow.gif?raw=true ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-hourglass/workflow.gif?raw=true )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-hourglass/workflow.gif?raw=true ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-map-reduce/workflow.gif?raw=true )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-map-reduce/workflow.gif?raw=true ) |
27
+ | [ aws_batch] ( ./runners/aws_batch.py ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-a-bc-d/workflow.gif?raw=true&random=48vRxCWtlxPwXppc )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-a-bc-d/workflow.gif?raw=true&random=48vRxCWtlxPwXppc ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-hourglass/workflow.gif?raw=true&random=zG1c8Avnf1MqV48H )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-hourglass/workflow.gif?raw=true&random=zG1c8Avnf1MqV48H ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-map-reduce/workflow.gif?raw=true&random=j2FuGAUEoNIYrZel )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/aws_batch-map-reduce/workflow.gif?raw=true&random=j2FuGAUEoNIYrZel ) |
28
+ | [ generic] ( ./runners/generic.py ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-a-bc-d/workflow.gif?raw=true&random=gYEm92XfCLfvKKVy )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-a-bc-d/workflow.gif?raw=true&random=gYEm92XfCLfvKKVy ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-hourglass/workflow.gif?raw=true&random=D2kwFvPHzU3AvnIA )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-hourglass/workflow.gif?raw=true&random=D2kwFvPHzU3AvnIA ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-map-reduce/workflow.gif?raw=true&random=K506yapZridmNJ2q )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/generic-map-reduce/workflow.gif?raw=true&random=K506yapZridmNJ2q ) |
29
+ | [ local] ( ./runners/local.py ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-a-bc-d/workflow.gif?raw=true&random=sxG8zRM1zGCsPMYr )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-a-bc-d/workflow.gif?raw=true&random=sxG8zRM1zGCsPMYr ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-hourglass/workflow.gif?raw=true&random=7HoUx3UxowsKM4GA )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-hourglass/workflow.gif?raw=true&random=7HoUx3UxowsKM4GA ) | [ ![ image] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-map-reduce/workflow.gif?raw=true&random=qFMwY24c2W5Uggo0 )] ( https://kamangir-public.s3.ca-central-1.amazonaws.com/local-map-reduce/workflow.gif?raw=true&random=qFMwY24c2W5Uggo0 ) |
30
30
31
31
32
32
related: [ 1] ( https://arash-kamangir.medium.com/%EF%B8%8F-openai-experiments-54-e49117dc69ef )
33
33
34
34
---
35
- built by [ ` abcli-9.192.1-current ` ] ( https://github.com/kamangir/awesome-bash-cli ) , based on [ ` notebooks_and_scripts-4.645 .1 ` ] ( https://github.com/kamangir/notebooks-and-scripts ) .
35
+ built by [ ` abcli-9.192.1-current ` ] ( https://github.com/kamangir/awesome-bash-cli ) , based on [ ` notebooks_and_scripts-4.649 .1 ` ] ( https://github.com/kamangir/notebooks-and-scripts ) .
Original file line number Diff line number Diff line change 1
1
from functools import reduce
2
+ from abcli import string
2
3
from notebooks_and_scripts .workflow .patterns import list_of_patterns
3
4
from notebooks_and_scripts .workflow .runners import list_of_runners
4
5
21
22
+ [
22
23
f"[]({ url } )"
23
24
for url in [
24
- "{}/{}-{}/workflow.gif?raw=true" .format (
25
+ "{}/{}-{}/workflow.gif?raw=true&random={} " .format (
25
26
prefix ,
26
27
runner_type ,
27
28
pattern ,
29
+ string .random_ (),
28
30
)
29
31
for pattern in list_of_patterns ()
30
32
]
Original file line number Diff line number Diff line change 1
1
import copy
2
+ import textwrap
2
3
from typing import Tuple , Dict , List
3
4
import numpy as np
4
5
import networkx as nx
@@ -48,6 +49,7 @@ def export_graph_as_image(
48
49
hot_node : str = "void" ,
49
50
add_legend : bool = True ,
50
51
caption : str = "" ,
52
+ text_width : int = 80 ,
51
53
) -> bool :
52
54
layout_func = layouts .get (layout , None )
53
55
if layout_func is None :
@@ -93,11 +95,16 @@ def export_graph_as_image(
93
95
caption_items += [G .nodes [hot_node ].get ("command_line" ).replace ('"' , "" )]
94
96
caption_items = [item for item in caption_items if item ]
95
97
98
+ caption_wrapped = textwrap .fill (
99
+ " | " .join (caption_items ),
100
+ width = text_width ,
101
+ )
102
+
96
103
if caption_items :
97
104
plt .text (
98
105
0.5 ,
99
106
0.5 ,
100
- " | " . join ( caption_items ) ,
107
+ caption_wrapped ,
101
108
horizontalalignment = "center" ,
102
109
verticalalignment = "center" ,
103
110
transform = plt .gca ().transAxes ,
You can’t perform that action at this time.
0 commit comments