blue-sandbox 5.47.1__py3-none-any.whl → 5.61.1__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  #! /usr/bin/env bash
2
2
 
3
- alias @damage="blue_sandbox_microsoft_building_damage_assessment"
3
+ alias @damages="blue_sandbox_microsoft_building_damage_assessment"
4
4
 
5
5
  alias @sandbox=blue_sandbox
@@ -26,8 +26,8 @@ function blue_sandbox_microsoft_building_damage_assessment_ingest() {
26
26
  pushd $object_path >/dev/null
27
27
 
28
28
  # https://github.com/microsoft/building-damage-assessment/blob/main/SATELLITE_WORKFLOW.md#1-image-acquisition-and-label-generation
29
- mkdir -pv data/demo/raw/
30
- cd data/demo/raw/
29
+ mkdir -pv raw
30
+ cd raw
31
31
 
32
32
  if [[ "$do_download" == 1 ]]; then
33
33
  # TODO: use $event_name and $count (options +=)
@@ -57,8 +57,6 @@ function blue_sandbox_microsoft_building_damage_assessment_ingest() {
57
57
  rm -v maxar_lahaina_8_12_2023-visual.vrt
58
58
  fi
59
59
 
60
- cd ../../..
61
-
62
60
  popd >/dev/null
63
61
 
64
62
  abcli_eval dryrun=$do_dryrun \
@@ -0,0 +1,26 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function blue_sandbox_microsoft_building_damage_assessment_label() {
4
+ local options=$1
5
+ local do_dryrun=$(abcli_option_int "$options" dryrun 0)
6
+ local do_download=$(abcli_option_int "$options" download $(abcli_not $do_dryrun))
7
+ local do_upload=$(abcli_option_int "$options" upload $(abcli_not $do_dryrun))
8
+
9
+ local object_name=$(abcli_clarify_object $2 .)
10
+ [[ "$do_download" == 1 ]] &&
11
+ abcli_download - $object_name
12
+
13
+ abcli_log "labeling $object_name ..."
14
+
15
+ abcli_eval dryrun=$do_dryrun \
16
+ python3 -m blue_sandbox.microsoft_building_damage_assessment \
17
+ label \
18
+ --object_name $object_name \
19
+ "${@:3}"
20
+ local status="$?"
21
+
22
+ [[ "$do_upload" == 1 ]] &&
23
+ abcli_upload - $object_name
24
+
25
+ return $status
26
+ }
@@ -7,9 +7,10 @@ function test_blue_sandbox_help() {
7
7
  for module in \
8
8
  "@sandbox" \
9
9
  \
10
- "@damage" \
11
- "@damage ingest" \
12
- "@damage ingest list" \
10
+ "@damages" \
11
+ "@damages ingest" \
12
+ "@damages ingest list" \
13
+ "@damages label" \
13
14
  \
14
15
  "blue_sandbox"; do
15
16
  abcli_eval ,$options \
@@ -0,0 +1,12 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_blue_sandbox_microsoft_building_damage_assessment_label() {
4
+ local options=$1
5
+
6
+ abcli_eval ,$options \
7
+ blue_sandbox_microsoft_building_damage_assessment \
8
+ label \
9
+ ~upload,$options \
10
+ $DAMAGES_TEST_DATASET_OBJECT_NAME \
11
+ "${@:2}"
12
+ }
blue_sandbox/README.py CHANGED
@@ -11,7 +11,7 @@ from blue_sandbox.microsoft_building_damage_assessment import (
11
11
  items = [
12
12
  "{}[`{}`]({}) [![image]({})]({}) {}".format(
13
13
  "🌐",
14
- "`@damage`",
14
+ "`@damages`",
15
15
  "https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md",
16
16
  "https://github.com/microsoft/building-damage-assessment/raw/main/figures/damage.png",
17
17
  "https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md",
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.47.1"
7
+ VERSION = "5.61.1"
8
8
 
9
9
  REPO_NAME = "blue-sandbox"
10
10
 
blue_sandbox/config.env CHANGED
@@ -1 +1 @@
1
- BLUE_PLUGIN_CONFIG=value
1
+ DAMAGES_TEST_DATASET_OBJECT_NAME=Maui-Hawaii-fires-Aug-23-ingest-2025-01-10-qqJqhm
blue_sandbox/env.py CHANGED
@@ -5,7 +5,7 @@ load_env(__name__)
5
5
  load_config(__name__)
6
6
 
7
7
 
8
- BLUE_PLUGIN_CONFIG = os.getenv(
9
- "BLUE_PLUGIN_CONFIG",
8
+ DAMAGES_TEST_DATASET_OBJECT_NAME = os.getenv(
9
+ "DAMAGES_TEST_DATASET_OBJECT_NAME",
10
10
  "",
11
11
  )
@@ -1,11 +1,19 @@
1
1
  from typing import Dict
2
2
 
3
+ from blue_sandbox.env import DAMAGES_TEST_DATASET_OBJECT_NAME
4
+
3
5
  list_of_steps: Dict[str, Dict] = {
4
- "ingest": "Maui-Hawaii-fires-Aug-23-damage-2025-01-09-GgnjQC",
5
- "label": "",
6
- "train": "",
7
- "predict": "",
8
- "summarize": "",
6
+ "ingest": {
7
+ "object_name": DAMAGES_TEST_DATASET_OBJECT_NAME,
8
+ "image_name": "Maui-Hawaii-fires-Aug-23-damage-2025-01-09-GgnjQC",
9
+ },
10
+ "label": {
11
+ "object_name": DAMAGES_TEST_DATASET_OBJECT_NAME,
12
+ "image_name": DAMAGES_TEST_DATASET_OBJECT_NAME,
13
+ },
14
+ "train": {"object_name": "", "image_name": ""},
15
+ "predict": {"object_name": "", "image_name": ""},
16
+ "summarize": {"object_name": "", "image_name": ""},
9
17
  }
10
18
 
11
19
  items = (
@@ -13,22 +21,22 @@ items = (
13
21
  + [
14
22
  (
15
23
  "[`{}`](https://kamangir-public.s3.ca-central-1.amazonaws.com/{}.tar.gz)".format(
16
- object_name,
17
- object_name,
24
+ step["object_name"],
25
+ step["image_name"],
18
26
  )
19
- if object_name
27
+ if step["object_name"]
20
28
  else ""
21
29
  )
22
- for object_name in list_of_steps.values()
30
+ for step in list_of_steps.values()
23
31
  ]
24
32
  + [
25
33
  (
26
- "[![image](https://github.com/kamangir/assets/blob/main/blue-sandbox/{}.png?raw=true)](#)".format(
27
- object_name,
34
+ "![image](https://github.com/kamangir/assets/blob/main/blue-sandbox/{}.png?raw=true)".format(
35
+ step["image_name"],
28
36
  )
29
- if object_name
37
+ if step["image_name"]
30
38
  else ""
31
39
  )
32
- for object_name in list_of_steps.values()
40
+ for step in list_of_steps.values()
33
41
  ]
34
42
  )
@@ -5,6 +5,7 @@ from blueness.argparse.generic import sys_exit
5
5
 
6
6
  from blue_sandbox import NAME
7
7
  from blue_sandbox.microsoft_building_damage_assessment.ingest import ingest
8
+ from blue_sandbox.microsoft_building_damage_assessment.label import label
8
9
  from blue_sandbox.help.microsoft_building_damage_assessment import list_of_events
9
10
  from blue_sandbox.logger import logger
10
11
 
@@ -14,7 +15,7 @@ parser = argparse.ArgumentParser(NAME)
14
15
  parser.add_argument(
15
16
  "task",
16
17
  type=str,
17
- help="ingest",
18
+ help="ingest | label",
18
19
  )
19
20
  parser.add_argument(
20
21
  "--object_name",
@@ -41,6 +42,11 @@ if args.task == "ingest":
41
42
  event_name=args.event_name,
42
43
  verbose=args.verbose == 1,
43
44
  )
45
+ elif args.task == "label":
46
+ success = label(
47
+ object_name=args.object_name,
48
+ verbose=args.verbose == 1,
49
+ )
44
50
  else:
45
51
  success = None
46
52
 
@@ -1,5 +1,7 @@
1
1
  from blueness import module
2
2
 
3
+ from blue_objects import mlflow, metadata
4
+
3
5
  from blue_sandbox import NAME
4
6
  from blue_sandbox.logger import logger
5
7
 
@@ -14,6 +16,16 @@ def ingest(
14
16
  ) -> bool:
15
17
  logger.info(f"{NAME}.ingest({event_name}) -> {object_name}")
16
18
 
17
- logger.info("🪄")
18
-
19
- return True
19
+ return all(
20
+ [
21
+ mlflow.set_tags(
22
+ object_name,
23
+ {"event": event_name},
24
+ ),
25
+ metadata.post_to_object(
26
+ object_name,
27
+ "ingest",
28
+ {"event": event_name},
29
+ ),
30
+ ]
31
+ )
@@ -0,0 +1,38 @@
1
+ import os
2
+
3
+ from blueness import module
4
+ from blue_objects import metadata, file, objects
5
+ from blue_objects.env import abcli_path_git
6
+
7
+ from blue_sandbox import NAME
8
+ from blue_sandbox.logger import logger
9
+
10
+
11
+ NAME = module.name(__file__, NAME)
12
+
13
+
14
+ def label(
15
+ object_name: str,
16
+ verbose: bool = False,
17
+ ) -> bool:
18
+ logger.info(f"{NAME}.label: {object_name}")
19
+
20
+ geojson_filename = os.path.join(
21
+ abcli_path_git,
22
+ "building-damage-assessment/data/demo/labels/Maui_Wildfires_August_0.geojson",
23
+ )
24
+
25
+ if not file.copy(
26
+ geojson_filename,
27
+ objects.path_of(
28
+ filename="label.geojson",
29
+ object_name=object_name,
30
+ ),
31
+ ):
32
+ return False
33
+
34
+ return metadata.post_to_object(
35
+ object_name,
36
+ "label",
37
+ {"geojson": geojson_filename},
38
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_sandbox
3
- Version: 5.47.1
3
+ Version: 5.61.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)
@@ -14,6 +14,7 @@ Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
15
  Requires-Dist: blueness
16
16
  Requires-Dist: blue-options
17
+ Requires-Dist: blue_objects
17
18
  Requires-Dist: abcli
18
19
  Requires-Dist: boto3
19
20
  Requires-Dist: geojson
@@ -47,11 +48,11 @@ pip install blue-sandbox
47
48
 
48
49
  | | | |
49
50
  | --- | --- | --- |
50
- | 🌐[``@damage``](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) [![image](https://github.com/microsoft/building-damage-assessment/raw/main/figures/damage.png)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) Satellite imagery damage assessment workflow | 🌀[`experiment 2`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 2 ... | 🌀[`experiment 3`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 3 ... |
51
+ | 🌐[``@damages``](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) [![image](https://github.com/microsoft/building-damage-assessment/raw/main/figures/damage.png)](https://github.com/kamangir/blue-sandbox/blob/main/blue_sandbox/microsoft_building_damage_assessment/README.md) Satellite imagery damage assessment workflow | 🌀[`experiment 2`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 2 ... | 🌀[`experiment 3`](#) [![image](https://github.com/kamangir/assets/raw/main/blue-plugin/marquee.png?raw=true)](#) description of experiment 3 ... |
51
52
 
52
53
  ---
53
54
 
54
55
 
55
56
  [![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)
56
57
 
57
- built by 🌀 [`blue_options-4.177.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.47.1`](https://github.com/kamangir/blue-sandbox).
58
+ built by 🌀 [`blue_options-4.180.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.61.1`](https://github.com/kamangir/blue-sandbox).
@@ -1,8 +1,8 @@
1
- blue_sandbox/README.py,sha256=gHxb5Czp9oyNZykiCKtI9Qnx08QJab8Ht9znKxHMkPs,1562
2
- blue_sandbox/__init__.py,sha256=yAwWd5-dAV4y8R3MW_B3K5FX1Hf7ZNCSnuNJCfrS_co,322
1
+ blue_sandbox/README.py,sha256=Q45yMxvgjPLPQAZCRzMQZx7Znxa0OAOaf3PZNvdaAyc,1563
2
+ blue_sandbox/__init__.py,sha256=PBOIZ8-3TUnl55Va85G6Nei76QFokd4SvH4mwVsMyxM,322
3
3
  blue_sandbox/__main__.py,sha256=aPRHSpGpk-bDbzhHpfLNsd3y1gGEHpnhoTF-RBweNwc,361
4
- blue_sandbox/config.env,sha256=89ao50sGXYWiU-NMV_fUVXAXdTHKKfWV03BY3_p6EOE,25
5
- blue_sandbox/env.py,sha256=ljEErQJNy0cdSvPpJ_ziMNvXK6Qlvi_8VBgTqjSm2uk,173
4
+ blue_sandbox/config.env,sha256=SHQeFdzivHKDimmTyHzVziCfAONN48DSDmc3WVG6gEw,82
5
+ blue_sandbox/env.py,sha256=EkFH_CX0foWzDaZrirjJpCKu_4wuvfLGqImmqnJMejk,201
6
6
  blue_sandbox/functions.py,sha256=U41kQFNPpfYV6KJpMnkqgqLkozqXiG4tgV6rj8IW1BU,7
7
7
  blue_sandbox/host.py,sha256=uJpiM105rnm6ySF16zA7waWekGBdec-dlpoRRU_QqwU,210
8
8
  blue_sandbox/logger.py,sha256=ZoFrTIfJJGNtZUm2d7lkQjdB2SPl_KBKDmHJOcIivPM,107
@@ -11,27 +11,30 @@ blue_sandbox/urls.py,sha256=tIZ36ONJEoUBM-tFhOpkVhLwb1OgLegUeEaBDqW4USM,24
11
11
  blue_sandbox/.abcli/abcli.sh,sha256=xsJ4IzuQsvLZog6U8VTBFVXsEi6ADe13L8rn47XtlbU,196
12
12
  blue_sandbox/.abcli/actions.sh,sha256=vImEUI105GRcxs2mAKGMqcvoErtmOPZZ-7dfSmUUxvE,230
13
13
  blue_sandbox/.abcli/aka.sh,sha256=RHDU_JbEEL2B0vvvRJ3NVSsRSEjSu09jNY85n7DLe-k,21
14
- blue_sandbox/.abcli/alias.sh,sha256=A2Q2VBfKuAiWc0yRXeDj95lL70elSdDKZTKWPTK-590,117
14
+ blue_sandbox/.abcli/alias.sh,sha256=q8j-uG7c0ZLp5BZhBKTXyESjMa_kcEH5Mf8pX4EgC7A,118
15
15
  blue_sandbox/.abcli/blue_sandbox.sh,sha256=PGRJOgNGlC3XL5cw4ecZH40LDuc_6NVazTKhCWtZ-3g,233
16
16
  blue_sandbox/.abcli/browse.sh,sha256=f8qa4qDVts2Am6_ldDwNeJXzhBQTk9PUKl0-a9wW1ww,287
17
17
  blue_sandbox/.abcli/install.sh,sha256=gRbmZfSMWd7RlmQaaXqQKuzuG9EXXA4at1R3KUfQ-qU,263
18
18
  blue_sandbox/.abcli/microsoft_building_damage_assessment.sh,sha256=wIP7BvltFj3Gx5VmSgT6hY67K1BnubELef93HHwKOU0,470
19
- blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest.sh,sha256=7ctyhe8wJ4RDJTOsrQ26FSYvtSizgBysSCGzL7Ap8f8,2701
19
+ blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest.sh,sha256=w_EUK_i4iSBpSy22TeexfF9jEAqzNwZuvjhpRraGKhA,2662
20
+ blue_sandbox/.abcli/microsoft_building_damage_assessment/label.sh,sha256=RROjENj93FhCBOkbe8K05e1fR5QNny0syobkX14rwho,795
20
21
  blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest/list.sh,sha256=9bEjpbwO7Heqd-E2RTM-ck4Q39Eqsv4ged6e0WmxmSs,452
21
22
  blue_sandbox/.abcli/tests/README.sh,sha256=rmJM-BPnTcmpPbJ5GXsF8vd_a84JKryeKkZyVScUing,145
22
- blue_sandbox/.abcli/tests/help.sh,sha256=ULiOsZDZ-M2T7fFoCZk3xyBNmJchFeizV_x_WHVqCko,404
23
+ blue_sandbox/.abcli/tests/help.sh,sha256=Nz7paLJB7fSthgfgBf4VGO6xcIs4Gt9OXeH-hQle_0M,434
23
24
  blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest.sh,sha256=oUUF8Kuyohxiqxo9FLY9EO0qlgkagntgfuFda6niHeM,426
24
25
  blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest_list.sh,sha256=5P0H-FHV7YKt1fenXAs_0cSFhJYWZ9u3LzRpfSRSptw,577
26
+ blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_label.sh,sha256=Envac5i9eGa5usDCO8MYfGFfyAZAT-f0KrrsAkaR91U,311
25
27
  blue_sandbox/.abcli/tests/version.sh,sha256=jF8zoJN1eKE3LfDeRVG9uHEosmEVJX6RtKfdioyeN-o,150
26
28
  blue_sandbox/help/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
27
29
  blue_sandbox/help/__main__.py,sha256=3Cqp5oISrZCOUApmwoQoCj_0sQgtkiEkm_ob3LFKzRE,234
28
30
  blue_sandbox/help/functions.py,sha256=Ki0nUGyHKDo2t0WnIVzBwxEVJHyRmHh-hIRv3ohJK3c,431
29
- blue_sandbox/microsoft_building_damage_assessment/README.py,sha256=AyZs8uYpZ7XSYs--5HkMHwgCfZZM1n_E-YWNZ6ncaO4,842
31
+ blue_sandbox/microsoft_building_damage_assessment/README.py,sha256=9-nfIbvfkOtFubKjuCheWZjWmjIXt559exBvLqb5x_s,1234
30
32
  blue_sandbox/microsoft_building_damage_assessment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
- blue_sandbox/microsoft_building_damage_assessment/__main__.py,sha256=rjjr-csHJd2jgO2GDlnAbbQAO_zbaXwA7n6Ce0UX0lM,1009
32
- blue_sandbox/microsoft_building_damage_assessment/ingest.py,sha256=F5GBHZ6s6QebC-w9e4QsRiQ6ZKxXjFbqckZqV8HDU1s,337
33
- blue_sandbox-5.47.1.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
34
- blue_sandbox-5.47.1.dist-info/METADATA,sha256=bC0hgpyotWeXyJ5d4tZVHOBdGX52KfabS3PtxkD85uQ,2756
35
- blue_sandbox-5.47.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
36
- blue_sandbox-5.47.1.dist-info/top_level.txt,sha256=4D9Cb9QUCaqdYAmBiCwvtlaYBtUYVVxv0Sxcr_pzgS8,13
37
- blue_sandbox-5.47.1.dist-info/RECORD,,
33
+ blue_sandbox/microsoft_building_damage_assessment/__main__.py,sha256=fOx7ijbm8SII94qqafU7sV6mT3MRYbq2RRvaZb4QR-E,1218
34
+ blue_sandbox/microsoft_building_damage_assessment/ingest.py,sha256=tBchn4dWPIqArwAe8JjEM2xZZlFtrgBRDV_Ko26OEiM,639
35
+ blue_sandbox/microsoft_building_damage_assessment/label.py,sha256=mpRNOsF8ChxSLwOyvwGmXiD7aO2xfivJPZTC5qwnLaw,823
36
+ blue_sandbox-5.61.1.dist-info/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
37
+ blue_sandbox-5.61.1.dist-info/METADATA,sha256=J3rNu-FENZdGbH_QQ5rKLOIrm0oaCumgzsWfu9tKJUI,2785
38
+ blue_sandbox-5.61.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
39
+ blue_sandbox-5.61.1.dist-info/top_level.txt,sha256=4D9Cb9QUCaqdYAmBiCwvtlaYBtUYVVxv0Sxcr_pzgS8,13
40
+ blue_sandbox-5.61.1.dist-info/RECORD,,