blue-sandbox 5.27.1__tar.gz → 5.38.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. {blue_sandbox-5.27.1/blue_sandbox.egg-info → blue_sandbox-5.38.1}/PKG-INFO +2 -2
  2. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/README.md +1 -1
  3. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/.abcli/install.sh +5 -0
  4. blue_sandbox-5.38.1/blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest.sh +67 -0
  5. blue_sandbox-5.38.1/blue_sandbox/.abcli/microsoft_building_damage_assessment.sh +15 -0
  6. blue_sandbox-5.38.1/blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest.sh +13 -0
  7. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/README.py +5 -0
  8. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/__init__.py +1 -1
  9. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/help/microsoft_building_damage_assessment.py +13 -2
  10. blue_sandbox-5.38.1/blue_sandbox/microsoft_building_damage_assessment/README.py +34 -0
  11. blue_sandbox-5.38.1/blue_sandbox/microsoft_building_damage_assessment/__main__.py +47 -0
  12. blue_sandbox-5.38.1/blue_sandbox/microsoft_building_damage_assessment/ingest.py +19 -0
  13. blue_sandbox-5.38.1/blue_sandbox/sample.env +0 -0
  14. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1/blue_sandbox.egg-info}/PKG-INFO +2 -2
  15. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox.egg-info/SOURCES.txt +8 -1
  16. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/setup.py +1 -0
  17. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/LICENSE +0 -0
  18. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/MANIFEST.in +0 -0
  19. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/.abcli/abcli.sh +0 -0
  20. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/.abcli/actions.sh +0 -0
  21. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/.abcli/aka.sh +0 -0
  22. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/.abcli/alias.sh +0 -0
  23. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/.abcli/blue_sandbox.sh +0 -0
  24. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/.abcli/browse.sh +0 -0
  25. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/.abcli/tests/README.sh +0 -0
  26. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/.abcli/tests/help.sh +0 -0
  27. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/.abcli/tests/version.sh +0 -0
  28. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/__main__.py +0 -0
  29. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/config.env +0 -0
  30. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/env.py +0 -0
  31. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/functions.py +0 -0
  32. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/help/__init__.py +0 -0
  33. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/help/__main__.py +0 -0
  34. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/help/functions.py +0 -0
  35. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/host.py +0 -0
  36. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/logger.py +0 -0
  37. /blue_sandbox-5.27.1/blue_sandbox/sample.env → /blue_sandbox-5.38.1/blue_sandbox/microsoft_building_damage_assessment/__init__.py +0 -0
  38. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox/urls.py +0 -0
  39. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox.egg-info/dependency_links.txt +0 -0
  40. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox.egg-info/requires.txt +0 -0
  41. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/blue_sandbox.egg-info/top_level.txt +0 -0
  42. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/pyproject.toml +0 -0
  43. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/requirements.txt +0 -0
  44. {blue_sandbox-5.27.1 → blue_sandbox-5.38.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_sandbox
3
- Version: 5.27.1
3
+ Version: 5.38.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)
@@ -54,4 +54,4 @@ pip install blue-sandbox
54
54
 
55
55
  [![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
56
 
57
- built by 🌀 [`blue_options-4.177.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.27.1`](https://github.com/kamangir/blue-sandbox).
57
+ built by 🌀 [`blue_options-4.177.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.38.1`](https://github.com/kamangir/blue-sandbox).
@@ -15,4 +15,4 @@ pip install blue-sandbox
15
15
 
16
16
  [![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)
17
17
 
18
- built by 🌀 [`blue_options-4.177.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.27.1`](https://github.com/kamangir/blue-sandbox).
18
+ built by 🌀 [`blue_options-4.177.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.38.1`](https://github.com/kamangir/blue-sandbox).
@@ -2,6 +2,11 @@
2
2
 
3
3
  function abcli_install_blue_sandbox() {
4
4
  abcli_git_clone https://github.com/microsoft/building-damage-assessment.git
5
+
6
+ [[ "$abcli_is_mac" == true ]] &&
7
+ brew install wget
8
+
9
+ return 0
5
10
  }
6
11
 
7
12
  abcli_install_module blue_sandbox 1.1.1
@@ -0,0 +1,67 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function blue_sandbox_microsoft_building_damage_assessment_ingest() {
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_gdal=$(abcli_option_int "$options" gdal 1)
8
+ local do_rm=$(abcli_option_int "$options" rm 1)
9
+ local do_upload=$(abcli_option_int "$options" upload $(abcli_not $do_dryrun))
10
+ local event_name=$(abcli_option "$options" event default)
11
+
12
+ local object_name=$(abcli_clarify_object $2 $event_name-ingest-$(abcli_string_timestamp_short))
13
+
14
+ abcli_log "ingesting $event_name -> $object_name ..."
15
+
16
+ local object_path=$ABCLI_OBJECT_ROOT/$object_name
17
+ mkdir -pv $object_path
18
+
19
+ pushd $object_path >/dev/null
20
+
21
+ # https://github.com/microsoft/building-damage-assessment/blob/main/SATELLITE_WORKFLOW.md#1-image-acquisition-and-label-generation
22
+ mkdir -pv data/demo/raw/
23
+ cd data/demo/raw/
24
+
25
+ if [[ "$do_download" == 1 ]]; then
26
+ abcli_eval ,$options \
27
+ wget https://maxar-opendata.s3.amazonaws.com/events/Maui-Hawaii-fires-Aug-23/ard/04/122000330002/2023-08-12/10300100EB15FF00-visual.tif
28
+ [[ $? -ne 0 ]] && return 1
29
+
30
+ abcli_eval ,$options \
31
+ wget https://maxar-opendata.s3.amazonaws.com/events/Maui-Hawaii-fires-Aug-23/ard/04/122000330020/2023-08-12/10300100EB15FF00-visual.tif
32
+ [[ $? -ne 0 ]] && return 1
33
+ fi
34
+
35
+ if [[ "$do_gdal" == 1 ]]; then
36
+ abcli_eval ,$options \
37
+ gdalbuildvrt maxar_lahaina_8_12_2023-visual.vrt *.tif*
38
+ [[ $? -ne 0 ]] && return 1
39
+
40
+ abcli_eval ,$options \
41
+ gdalwarp -co BIGTIFF=YES -co NUM_THREADS=ALL_CPUS -co COMPRESS=LZW -co PREDICTOR=2 -of COG maxar_lahaina_8_12_2023-visual.vrt maxar_lahaina_8_12_2023-visual.tif
42
+ [[ $? -ne 0 ]] && return 1
43
+ fi
44
+
45
+ if [[ "$do_rm" == 1 ]]; then
46
+ abcli_log "removing raw data ..."
47
+ rm -v 10300100EB15FF00-visual.tif*
48
+ rm -v maxar_lahaina_8_12_2023-visual.vrt
49
+ fi
50
+
51
+ cd ../../..
52
+
53
+ popd >/dev/null
54
+
55
+ abcli_eval dryrun=$do_dryrun \
56
+ python3 -m blue_sandbox.microsoft_building_damage_assessment \
57
+ ingest \
58
+ --event_name $event_name \
59
+ --object_name $object_name \
60
+ "${@:3}"
61
+ local status="$?"
62
+
63
+ [[ "$do_upload" == 1 ]] &&
64
+ abcli_upload - $object_name
65
+
66
+ return $status
67
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function blue_sandbox_microsoft_building_damage_assessment() {
4
+ local task=$(abcli_unpack_keyword $1 help)
5
+
6
+ local function_name=blue_sandbox_microsoft_building_damage_assessment_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m blue_sandbox.microsoft_building_damage_assessment "$@"
13
+ }
14
+
15
+ abcli_source_caller_suffix_path /microsoft_building_damage_assessment
@@ -0,0 +1,13 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_blue_sandbox_microsoft_building_damage_assessment_ingest() {
4
+ local options=$1
5
+
6
+ abcli_eval ,$options \
7
+ blue_sandbox_microsoft_building_damage_assessment \
8
+ ingest \
9
+ event=Maui-Hawaii-fires-Aug-23,~upload,$options \
10
+ test_blue_sandbox_microsoft_building_damage_assessment_ingest-$(abcli_string_timestamp_short) \
11
+ --verbose 1 \
12
+ "${@:2}"
13
+ }
@@ -3,6 +3,9 @@ import os
3
3
  from blue_objects import file, README
4
4
 
5
5
  from blue_sandbox import NAME, VERSION, ICON, REPO_NAME
6
+ from blue_sandbox.microsoft_building_damage_assessment import (
7
+ README as microsoft_building_damage_assessment_README,
8
+ )
6
9
 
7
10
 
8
11
  items = [
@@ -34,6 +37,8 @@ def build():
34
37
  VERSION=VERSION,
35
38
  REPO_NAME=REPO_NAME,
36
39
  ) and README.build(
40
+ items=microsoft_building_damage_assessment_README.items,
41
+ cols=len(microsoft_building_damage_assessment_README.list_of_steps),
37
42
  path=os.path.join(file.path(__file__), "microsoft_building_damage_assessment"),
38
43
  ICON=ICON,
39
44
  NAME=NAME,
@@ -4,7 +4,7 @@ ICON = "🌀"
4
4
 
5
5
  DESCRIPTION = f"{ICON} A sandbox for ideas and experiments."
6
6
 
7
- VERSION = "5.27.1"
7
+ VERSION = "5.38.1"
8
8
 
9
9
  REPO_NAME = "blue-sandbox"
10
10
 
@@ -2,12 +2,20 @@ from typing import List
2
2
 
3
3
  from blue_options.terminal import show_usage, xtra
4
4
 
5
+ list_of_events = ["Maui-Hawaii-fires-Aug-23"]
6
+
5
7
 
6
8
  def help_ingest(
7
9
  tokens: List[str],
8
10
  mono: bool,
9
11
  ) -> str:
10
- options = xtra("~download,~upload", mono=mono)
12
+ options = "".join(
13
+ [
14
+ xtra("~download,dryrun,", mono=mono),
15
+ "event=<event>",
16
+ xtra(",~gdal,~rm,~upload", mono=mono),
17
+ ]
18
+ )
11
19
 
12
20
  args = [
13
21
  "[--verbose 1]",
@@ -21,7 +29,10 @@ def help_ingest(
21
29
  "[-|<object-name>]",
22
30
  ]
23
31
  + args,
24
- "ingest @damage data.",
32
+ "ingest <event> -> <object-name>.",
33
+ {
34
+ "event: {}".format(" | ".join(list_of_events)): [],
35
+ },
25
36
  mono=mono,
26
37
  )
27
38
 
@@ -0,0 +1,34 @@
1
+ from typing import Dict
2
+
3
+ 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": "",
9
+ }
10
+
11
+ items = (
12
+ [f"`{step}`" for step in list_of_steps]
13
+ + [
14
+ (
15
+ "[`{}`](https://kamangir-public.s3.ca-central-1.amazonaws.com/{}.tar.gz)".format(
16
+ object_name,
17
+ object_name,
18
+ )
19
+ if object_name
20
+ else ""
21
+ )
22
+ for object_name in list_of_steps.values()
23
+ ]
24
+ + [
25
+ (
26
+ "[![image](https://github.com/kamangir/assets/blob/main/blue-sandbox/{}.png?raw=true)](#)".format(
27
+ object_name,
28
+ )
29
+ if object_name
30
+ else ""
31
+ )
32
+ for object_name in list_of_steps.values()
33
+ ]
34
+ )
@@ -0,0 +1,47 @@
1
+ import argparse
2
+
3
+ from blueness import module
4
+ from blueness.argparse.generic import sys_exit
5
+
6
+ from blue_sandbox import NAME
7
+ from blue_sandbox.microsoft_building_damage_assessment.ingest import ingest
8
+ from blue_sandbox.help.microsoft_building_damage_assessment import list_of_events
9
+ from blue_sandbox.logger import logger
10
+
11
+ NAME = module.name(__file__, NAME)
12
+
13
+ parser = argparse.ArgumentParser(NAME)
14
+ parser.add_argument(
15
+ "task",
16
+ type=str,
17
+ help="ingest",
18
+ )
19
+ parser.add_argument(
20
+ "--object_name",
21
+ type=str,
22
+ )
23
+ parser.add_argument(
24
+ "--event_name",
25
+ type=str,
26
+ default=list_of_events[0],
27
+ help=" | ".join(list_of_events),
28
+ )
29
+ parser.add_argument(
30
+ "--verbose",
31
+ type=bool,
32
+ default=0,
33
+ help="0|1",
34
+ )
35
+ args = parser.parse_args()
36
+
37
+ success = False
38
+ if args.task == "ingest":
39
+ success = ingest(
40
+ object_name=args.object_name,
41
+ event_name=args.event_name,
42
+ verbose=args.verbose == 1,
43
+ )
44
+ else:
45
+ success = None
46
+
47
+ sys_exit(logger, NAME, args.task, success)
@@ -0,0 +1,19 @@
1
+ from blueness import module
2
+
3
+ from blue_sandbox import NAME
4
+ from blue_sandbox.logger import logger
5
+
6
+
7
+ NAME = module.name(__file__, NAME)
8
+
9
+
10
+ def ingest(
11
+ event_name: str,
12
+ object_name: str,
13
+ verbose: bool = False,
14
+ ) -> bool:
15
+ logger.info(f"{NAME}.ingest({event_name}) -> {object_name}")
16
+
17
+ logger.info("🪄")
18
+
19
+ return True
File without changes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_sandbox
3
- Version: 5.27.1
3
+ Version: 5.38.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)
@@ -54,4 +54,4 @@ pip install blue-sandbox
54
54
 
55
55
  [![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
56
 
57
- built by 🌀 [`blue_options-4.177.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.27.1`](https://github.com/kamangir/blue-sandbox).
57
+ built by 🌀 [`blue_options-4.177.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.38.1`](https://github.com/kamangir/blue-sandbox).
@@ -26,10 +26,17 @@ blue_sandbox/.abcli/alias.sh
26
26
  blue_sandbox/.abcli/blue_sandbox.sh
27
27
  blue_sandbox/.abcli/browse.sh
28
28
  blue_sandbox/.abcli/install.sh
29
+ blue_sandbox/.abcli/microsoft_building_damage_assessment.sh
30
+ blue_sandbox/.abcli/microsoft_building_damage_assessment/ingest.sh
29
31
  blue_sandbox/.abcli/tests/README.sh
30
32
  blue_sandbox/.abcli/tests/help.sh
33
+ blue_sandbox/.abcli/tests/microsoft_building_damage_assessment_ingest.sh
31
34
  blue_sandbox/.abcli/tests/version.sh
32
35
  blue_sandbox/help/__init__.py
33
36
  blue_sandbox/help/__main__.py
34
37
  blue_sandbox/help/functions.py
35
- blue_sandbox/help/microsoft_building_damage_assessment.py
38
+ blue_sandbox/help/microsoft_building_damage_assessment.py
39
+ blue_sandbox/microsoft_building_damage_assessment/README.py
40
+ blue_sandbox/microsoft_building_damage_assessment/__init__.py
41
+ blue_sandbox/microsoft_building_damage_assessment/__main__.py
42
+ blue_sandbox/microsoft_building_damage_assessment/ingest.py
@@ -10,6 +10,7 @@ setup(
10
10
  packages=[
11
11
  NAME,
12
12
  f"{NAME}.help",
13
+ f"{NAME}.microsoft_building_damage_assessment",
13
14
  ],
14
15
  include_package_data=True,
15
16
  package_data={
File without changes
File without changes
File without changes