blue-sandbox 5.133.1__py3-none-any.whl → 5.142.1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,40 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function cloudwatch() {
4
+ roofAI_cloudwatch "$@"
5
+ }
6
+
7
+ function roofAI_cloudwatch() {
8
+ local task=${1:=help}
9
+
10
+ if [ "$task" == "help" ]; then
11
+ local options="endpoint"
12
+ abcli_show_usage "cloudwatch browse$EOP$ABCUL[$options]$ABCUL[<endpoint-name>]$EOPE" \
13
+ "browse endpoint on cloudwatch." \
14
+ "default endpoint: $(roofAI_inference_default_endpoint)"
15
+ return
16
+ fi
17
+
18
+ local options=$2
19
+
20
+ # https://docs.aws.amazon.com/sagemaker/latest/dg/logging-cloudwatch.html
21
+ if [ "$task" == "browse" ]; then
22
+ local object_type=$(abcli_option_choice "$options" endpoint endpoint)
23
+
24
+ local url=""
25
+ if [[ "$object_type" == endpoint ]]; then
26
+ local endpoint_name=$(abcli_clarify_input $3 $(roofAI_inference_default_endpoint))
27
+ abcli_log "🔗 endpoint: $endpoint_name"
28
+ url="https://$ABCLI_AWS_REGION.console.aws.amazon.com/cloudwatch/home?region=$ABCLI_AWS_REGION#logEventViewer:group=/aws/sagemaker/Endpoints/$endpoint_name"
29
+ else
30
+ abcli_log_error "-cloudwatch: $task: $object_type: object type not found."
31
+ return 1
32
+ fi
33
+
34
+ abcli_browse $url
35
+ return
36
+ fi
37
+
38
+ abcli_log_error "-roofAI: cloudwatch: $task: command not found."
39
+ return 1
40
+ }
@@ -0,0 +1,155 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function roofAI_inference() {
4
+ local task=$(abcli_unpack_keyword $1 help)
5
+
6
+ if [ "$task" == "help" ]; then
7
+ for task in create delete describe invoke list pull; do
8
+ roofAI_inference "$task" "$@"
9
+ done
10
+ return
11
+ fi
12
+ local options=$2
13
+
14
+ if [ $(abcli_option_int "$options" help 0) == 1 ]; then
15
+ case $task in
16
+ "create")
17
+ local args="[--verbose 1]$ABCUL[--verify 0]"
18
+ local options="dryrun,model"
19
+ abcli_show_usage "roofAI inference create$ABCUL[$options]$ABCUL[.|<object-name>]$ABCUL$args" \
20
+ "create inference model."
21
+
22
+ local options="dryrun,endpoint_config,suffix=<suffix>"
23
+ abcli_show_usage "roofAI inference create$ABCUL[$options]$ABCUL[.|<object-name>]$ABCUL$args" \
24
+ "create inference endpoint config."
25
+
26
+ local options="dryrun,endpoint,config_suffix=<suffix>,suffix=<suffix>"
27
+ abcli_show_usage "roofAI inference create$ABCUL[$options]$ABCUL[.|<object-name>]$ABCUL$args" \
28
+ "create inference endpoint."
29
+ ;;
30
+ "delete")
31
+ local args="[--verbose 1]"
32
+ local options="dryrun,model|endpoint_config|endpoint"
33
+ abcli_show_usage "roofAI inference delete$ABCUL[$options]$ABCUL<name>$ABCUL$args" \
34
+ "delete inference object."
35
+ ;;
36
+ "describe")
37
+ local args="[--verbose 1]"
38
+ local options="dryrun,endpoint"
39
+ abcli_show_usage "roofAI inference describe$ABCUL[$options]$ABCUL<name>$ABCUL$args" \
40
+ "describe inference endpoint."
41
+ ;;
42
+ "invoke")
43
+ local args="[--verbose 1]"
44
+ local options="~download,dryrun,profile=$semseg_profiles,upload"
45
+ abcli_show_usage "roofAI inference invoke$EOP$ABCUL[$options]$ABCUL[-|<endpoint-name>]$ABCUL[..|<dataset-object-name>]$ABCUL[-|<prediction-object-name>]$ABCUL$args$EOPE" \
46
+ "<dataset-object-name> -> inference endpoint -> <prediction-object-name>." \
47
+ "default endpoint: $(roofAI_inference_default_endpoint)"
48
+ ;;
49
+ "list")
50
+ local args="[--verbose 1]"
51
+ local options="dryrun,model|endpoint_config|endpoint,contains=<string>"
52
+ abcli_show_usage "roofAI inference list$ABCUL[$options]$ABCUL$args" \
53
+ "list inference objects."
54
+ ;;
55
+ "pull")
56
+ local options="dryrun"
57
+ abcli_show_usage "roofAI inference pull$ABCUL[$options]" \
58
+ "pull the inference image."
59
+ ;;
60
+ esac
61
+ return
62
+ fi
63
+
64
+ if [[ ",create,delete,describe,list," == *",$task,"* ]]; then
65
+ local object_type=$(abcli_option_choice "$options" model,endpoint_config,endpoint model)
66
+ local do_dryrun=$(abcli_option_int "$options" dryrun 0)
67
+ fi
68
+
69
+ if [[ "$task" == "create" ]]; then
70
+ local object_name=$(abcli_clarify_object $3 .)
71
+
72
+ [[ "$object_type" == "model" ]] &&
73
+ abcli_upload solid,~warn_if_exists $object_name
74
+
75
+ abcli_eval dryrun=$do_dryrun \
76
+ python3 -m roofAI.inference create \
77
+ --suffix $(abcli_option "$options" suffix -) \
78
+ --config_suffix $(abcli_option "$options" config_suffix -) \
79
+ --object_type "$object_type" \
80
+ --object_name "$object_name" \
81
+ "${@:4}"
82
+ return
83
+ fi
84
+
85
+ if [[ ",delete,describe," == *",$task,"* ]]; then
86
+ abcli_eval dryrun=$do_dryrun \
87
+ python3 -m roofAI.inference $task \
88
+ --object_type "$object_type" \
89
+ --object_name "$3" \
90
+ "${@:4}"
91
+ return
92
+ fi
93
+
94
+ if [[ "$task" == "invoke" ]]; then
95
+ local do_dryrun=$(abcli_option_int "$options" dryrun 0)
96
+ local do_download=$(abcli_option_int "$options" download $(abcli_not $do_dryrun))
97
+ local do_upload=$(abcli_option_int "$options" upload $(abcli_not $do_dryrun))
98
+
99
+ local endpoint_name=$(abcli_clarify_input $3 $(roofAI_inference_default_endpoint))
100
+
101
+ local dataset_object_name=$(abcli_clarify_object $4 ..)
102
+ [[ "$do_download" == 1 ]] &&
103
+ abcli_download - $dataset_object_name
104
+
105
+ local prediction_object_name=$(abcli_clarify_object $5 $(abcli_string_timestamp))
106
+
107
+ abcli_log "endpoint[$endpoint_name].invoke($dataset_object_name) -> $prediction_object_name."
108
+
109
+ abcli_eval dryrun=$do_dryrun \
110
+ python3 -m roofAI.inference $task \
111
+ --endpoint_name $endpoint_name \
112
+ --dataset_path $ABCLI_OBJECT_ROOT/$dataset_object_name \
113
+ --prediction_path $ABCLI_OBJECT_ROOT/$prediction_object_name \
114
+ --profile $(abcli_option "$options" profile VALIDATION) \
115
+ "${@:6}"
116
+
117
+ [[ "$do_upload" == 1 ]] &&
118
+ abcli_upload - $prediction_object_name
119
+
120
+ return
121
+ fi
122
+
123
+ if [[ "$task" == "list" ]]; then
124
+ abcli_eval dryrun=$do_dryrun \
125
+ python3 -m roofAI.inference $task \
126
+ --object_type "$object_type" \
127
+ --object_name $(abcli_option "$options" contains -) \
128
+ "${@:3}"
129
+ return
130
+ fi
131
+
132
+ if [ "$task" == "pull" ]; then
133
+ aws ecr get-login-password \
134
+ --region $ABCLI_AWS_REGION |
135
+ docker login \
136
+ --username AWS \
137
+ --password-stdin \
138
+ 763104351884.dkr.ecr.$ABCLI_AWS_REGION.amazonaws.com
139
+ [[ $? -ne 0 ]] && return 1
140
+
141
+ local image_name=$(python3 -m roofAI.inference.image get --what name)
142
+ abcli_log "🔗 image name: $image_name"
143
+ abcli_eval dryrun=$do_dryrun \
144
+ docker pull $image_name
145
+
146
+ return
147
+ fi
148
+
149
+ abcli_log_error "-roofAI: inference: $task: command not found."
150
+ return 1
151
+ }
152
+
153
+ function roofAI_inference_default_endpoint() {
154
+ echo endpoint-$(abcli_cache read roofAI_semseg_model_AIRS_o2)-pytorch
155
+ }
blue_sandbox/README.py CHANGED
@@ -34,6 +34,13 @@ def build():
34
34
  VERSION=VERSION,
35
35
  REPO_NAME=REPO_NAME,
36
36
  ),
37
+ README.build(
38
+ path=os.path.join(file.path(__file__), "cemetery"),
39
+ ICON=ICON,
40
+ NAME=NAME,
41
+ VERSION=VERSION,
42
+ REPO_NAME=REPO_NAME,
43
+ ),
37
44
  README.build(
38
45
  items=microsoft_building_damage_assessment_README.items,
39
46
  cols=len(microsoft_building_damage_assessment_README.list_of_steps),
blue_sandbox/__init__.py CHANGED
@@ -4,7 +4,7 @@ ICON = "🌀"
4
4
 
5
5
  DESCRIPTION = f"{ICON} A sandbox for ideas and experiments."
6
6
 
7
- VERSION = "5.133.1"
7
+ VERSION = "5.142.1"
8
8
 
9
9
  REPO_NAME = "blue-sandbox"
10
10
 
blue_sandbox/list.py CHANGED
@@ -13,6 +13,13 @@ list_of_experiments = {
13
13
  "marquee": "https://github.com/kamangir/assets/raw/main/blue-sandbox/Maui-Hawaii-fires-Aug-23-ingest-2025-01-10-qqJqhm.png?raw=true",
14
14
  "status": "⏸️",
15
15
  },
16
+ "cemetery": {
17
+ "ICON": "🪦",
18
+ "title": "A code cemetery.",
19
+ "url": "https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/cemetery/README.md",
20
+ "marquee": "https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true",
21
+ "status": "🪦",
22
+ },
16
23
  "template": {
17
24
  "ICON": "",
18
25
  "title": "",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_sandbox
3
- Version: 5.133.1
3
+ Version: 5.142.1
4
4
  Summary: 🌀 A sandbox for ideas and experiments.
5
5
  Home-page: https://github.com/kamangir/blue-sandbox
6
6
  Author: Arash Abadpour (Kamangir)
@@ -19,6 +19,7 @@ Requires-Dist: blue_objects
19
19
  Requires-Dist: blue_geo
20
20
  Requires-Dist: blueflow
21
21
  Requires-Dist: blue_plugin
22
+ Requires-Dist: roofAI
22
23
  Requires-Dist: boto3
23
24
  Requires-Dist: geojson
24
25
  Requires-Dist: geopandas
@@ -53,13 +54,13 @@ Dynamic: summary
53
54
  pip install blue-sandbox
54
55
  ```
55
56
 
56
- | | |
57
- | --- | --- |
58
- | 🌀[`sagesemseg`](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/sagesemseg/README.md) ⏸️ [![image](https://github.com/kamangir/assets/blob/main/blue-sandbox/sagesemseg-predict.png?raw=true)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/sagesemseg/README.md) A SemSeg (Semantic Segmenter) trained and deployed on AWS Sagemaker. | 🌐[``@damages``](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) ⏸️ [![image](https://github.com/kamangir/assets/raw/main/blue-sandbox/Maui-Hawaii-fires-Aug-23-ingest-2025-01-10-qqJqhm.png?raw=true)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) Satellite imagery damage assessment workflow |
57
+ | | | |
58
+ | --- | --- | --- |
59
+ | 🌀[`sagesemseg`](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/sagesemseg/README.md) ⏸️ [![image](https://github.com/kamangir/assets/blob/main/blue-sandbox/sagesemseg-predict.png?raw=true)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/sagesemseg/README.md) A SemSeg (Semantic Segmenter) trained and deployed on AWS Sagemaker. | 🌐[``@damages``](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) ⏸️ [![image](https://github.com/kamangir/assets/raw/main/blue-sandbox/Maui-Hawaii-fires-Aug-23-ingest-2025-01-10-qqJqhm.png?raw=true)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) Satellite imagery damage assessment workflow | 🪦[`cemetery`](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/cemetery/README.md) 🪦 [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/cemetery/README.md) A code cemetery. |
59
60
 
60
61
  ---
61
62
 
62
63
 
63
64
  [![pylint](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-sandbox.svg)](https://pypi.org/project/blue-sandbox/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-sandbox)](https://pypistats.org/packages/blue-sandbox)
64
65
 
65
- built by 🌀 [`blue_options-4.185.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.133.1`](https://github.com/kamangir/blue-sandbox).
66
+ built by 🌀 [`blue_options-4.185.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.142.1`](https://github.com/kamangir/blue-sandbox).
@@ -1,11 +1,11 @@
1
- blue_sandbox/README.py,sha256=AGJRj2u50FeYFd4ooGg0WucPI5E6lZxdqrJTXQ4-BCc,1658
2
- blue_sandbox/__init__.py,sha256=fsjZ1GuNOuA1y4Cn2PvCXo_x8mktXWEp0v4V7ABZegc,323
1
+ blue_sandbox/README.py,sha256=a2VhwY8bf5_GULuHNd6sw2nDlJRHJLAMxp1OcWtp06k,1891
2
+ blue_sandbox/__init__.py,sha256=sFh84cYvI8-WKQQJakQxXHx_F-KoFJNG6OIA_lxQuc4,323
3
3
  blue_sandbox/__main__.py,sha256=aPRHSpGpk-bDbzhHpfLNsd3y1gGEHpnhoTF-RBweNwc,361
4
4
  blue_sandbox/config.env,sha256=V66pxIEv4ZSBK3XKVD7_Ubqld5EQTH5-HLfF_7j8UvU,307
5
5
  blue_sandbox/env.py,sha256=Fw8_TYRE8kG49c1M9MCz62tW7Ulgbpr4Mof-F5xzVlY,519
6
6
  blue_sandbox/functions.py,sha256=U41kQFNPpfYV6KJpMnkqgqLkozqXiG4tgV6rj8IW1BU,7
7
7
  blue_sandbox/host.py,sha256=uJpiM105rnm6ySF16zA7waWekGBdec-dlpoRRU_QqwU,210
8
- blue_sandbox/list.py,sha256=ly9ZwbsO4hr67sbLjjsIJzzJMX4Mi-ftyabyFelans8,1034
8
+ blue_sandbox/list.py,sha256=3GFdvJdZZuYir5FbWNF-xv6oYAH6vr2RRquz75P8CEs,1346
9
9
  blue_sandbox/logger.py,sha256=ZoFrTIfJJGNtZUm2d7lkQjdB2SPl_KBKDmHJOcIivPM,107
10
10
  blue_sandbox/sample.env,sha256=ovfKDKAIeuqWBmMDKeAint_SKTnZuyDU1TCBZ-Y3Iqg,28
11
11
  blue_sandbox/urls.py,sha256=tIZ36ONJEoUBM-tFhOpkVhLwb1OgLegUeEaBDqW4USM,24
@@ -17,6 +17,8 @@ blue_sandbox/.abcli/blue_sandbox.sh,sha256=PGRJOgNGlC3XL5cw4ecZH40LDuc_6NVazTKhC
17
17
  blue_sandbox/.abcli/browse.sh,sha256=f8qa4qDVts2Am6_ldDwNeJXzhBQTk9PUKl0-a9wW1ww,287
18
18
  blue_sandbox/.abcli/install.sh,sha256=zvl0GsHBmfw62ORmkMlhug264N_Zr8nc3rlPGFoq7Mk,125
19
19
  blue_sandbox/.abcli/microsoft_building_damage_assessment.sh,sha256=wIP7BvltFj3Gx5VmSgT6hY67K1BnubELef93HHwKOU0,470
20
+ blue_sandbox/.abcli/cemetery/inference/cloudwatch.sh,sha256=Pg77qN8kc4AZgQPED1cQAjrmTaReN3K2_PHjSnYcvfA,1307
21
+ blue_sandbox/.abcli/cemetery/inference/inference.sh,sha256=vyZTBOvpUay65BEjv7d8WjK0PXG7D-JodOorRuP3nIw,5921
20
22
  blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest.sh,sha256=w_EUK_i4iSBpSy22TeexfF9jEAqzNwZuvjhpRraGKhA,2662
21
23
  blue_sandbox/.abcli/microsoft_building_damage_assessment/install.sh,sha256=M7MhMfGK0lKGG5CxegrhRgT7eL0Gzix6dY-8w6P0V8g,1509
22
24
  blue_sandbox/.abcli/microsoft_building_damage_assessment/label.sh,sha256=RROjENj93FhCBOkbe8K05e1fR5QNny0syobkX14rwho,795
@@ -45,8 +47,8 @@ blue_sandbox/microsoft_building_damage_assessment/ingest.py,sha256=tBchn4dWPIqAr
45
47
  blue_sandbox/microsoft_building_damage_assessment/label.py,sha256=mpRNOsF8ChxSLwOyvwGmXiD7aO2xfivJPZTC5qwnLaw,823
46
48
  blue_sandbox/microsoft_building_damage_assessment/sas_token.py,sha256=t6oTXc6C52CH3tFbQo2H9YUB_7upAsfUwws43Iu9pHI,214
47
49
  blue_sandbox/microsoft_building_damage_assessment/train.py,sha256=8DUt0S4LuKkRIi9XpASOg5skPaM3D2VaSBg5FEn8qog,2778
48
- blue_sandbox-5.133.1.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
49
- blue_sandbox-5.133.1.dist-info/METADATA,sha256=1KWLC_dMek4vq8tx2_ZmebTn1Sh6Zmoxu-mWEsxfJpc,3079
50
- blue_sandbox-5.133.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
51
- blue_sandbox-5.133.1.dist-info/top_level.txt,sha256=4D9Cb9QUCaqdYAmBiCwvtlaYBtUYVVxv0Sxcr_pzgS8,13
52
- blue_sandbox-5.133.1.dist-info/RECORD,,
50
+ blue_sandbox-5.142.1.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
51
+ blue_sandbox-5.142.1.dist-info/METADATA,sha256=2CN5PyIjOdCEfDsAofdNk9s7vTdWiEdf9YmROhC11iQ,3409
52
+ blue_sandbox-5.142.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
53
+ blue_sandbox-5.142.1.dist-info/top_level.txt,sha256=4D9Cb9QUCaqdYAmBiCwvtlaYBtUYVVxv0Sxcr_pzgS8,13
54
+ blue_sandbox-5.142.1.dist-info/RECORD,,