bluer-objects 6.104.1__py3-none-any.whl → 6.464.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bluer_objects/.abcli/abcli.sh +6 -0
- bluer_objects/.abcli/alias.sh +13 -6
- bluer_objects/.abcli/assets/cd.sh +20 -0
- bluer_objects/.abcli/assets/mv.sh +34 -0
- bluer_objects/.abcli/assets/publish.sh +40 -0
- bluer_objects/.abcli/assets.sh +15 -0
- bluer_objects/.abcli/create_test_asset.sh +10 -0
- bluer_objects/.abcli/download.sh +3 -1
- bluer_objects/.abcli/file.sh +15 -4
- bluer_objects/.abcli/gif.sh +18 -0
- bluer_objects/.abcli/host.sh +23 -7
- bluer_objects/.abcli/ls.sh +19 -8
- bluer_objects/.abcli/metadata/download.sh +9 -0
- bluer_objects/.abcli/metadata/edit.sh +15 -0
- bluer_objects/.abcli/metadata/upload.sh +9 -0
- bluer_objects/.abcli/mlflow/browse.sh +2 -0
- bluer_objects/.abcli/mlflow/deploy.sh +21 -5
- bluer_objects/.abcli/mlflow/lock/lock.sh +11 -0
- bluer_objects/.abcli/mlflow/lock/unlock.sh +12 -0
- bluer_objects/.abcli/mlflow/lock.sh +15 -0
- bluer_objects/.abcli/mlflow/tags/search.sh +1 -5
- bluer_objects/.abcli/mlflow.sh +0 -2
- bluer_objects/.abcli/pdf/convert.sh +92 -0
- bluer_objects/.abcli/pdf.sh +15 -0
- bluer_objects/.abcli/storage/clear.sh +2 -0
- bluer_objects/.abcli/tests/clone.sh +2 -3
- bluer_objects/.abcli/tests/create_test_asset.sh +16 -0
- bluer_objects/.abcli/tests/file.sh +64 -0
- bluer_objects/.abcli/tests/gif.sh +3 -3
- bluer_objects/.abcli/tests/help.sh +23 -7
- bluer_objects/.abcli/tests/ls.sh +11 -4
- bluer_objects/.abcli/tests/metadata.sh +35 -0
- bluer_objects/.abcli/tests/mlflow_lock.sh +30 -0
- bluer_objects/.abcli/tests/mlflow_tags.sh +1 -1
- bluer_objects/.abcli/tests/open.sh +11 -0
- bluer_objects/.abcli/tests/open_gif_open.sh +14 -0
- bluer_objects/.abcli/tests/pdf.sh +39 -0
- bluer_objects/.abcli/tests/storage_clear.sh +11 -0
- bluer_objects/.abcli/tests/storage_public_upload.sh +25 -0
- bluer_objects/.abcli/tests/storage_status.sh +12 -0
- bluer_objects/.abcli/tests/{storage.sh → storage_upload_download.sh} +26 -8
- bluer_objects/.abcli/upload.sh +26 -2
- bluer_objects/README/__init__.py +7 -22
- bluer_objects/README/alias.py +67 -0
- bluer_objects/README/build/__init__.py +0 -0
- bluer_objects/README/build/aliases.py +23 -0
- bluer_objects/README/build/docs.py +23 -0
- bluer_objects/README/build/modules.py +9 -0
- bluer_objects/README/consts.py +44 -0
- bluer_objects/README/functions.py +154 -204
- bluer_objects/README/items.py +78 -6
- bluer_objects/README/process/__init__.py +0 -0
- bluer_objects/README/process/assets.py +36 -0
- bluer_objects/README/process/details.py +20 -0
- bluer_objects/README/process/envs.py +23 -0
- bluer_objects/README/process/help.py +27 -0
- bluer_objects/README/process/include.py +40 -0
- bluer_objects/README/process/legacy.py +21 -0
- bluer_objects/README/process/mermaid.py +20 -0
- bluer_objects/README/process/national_internet.py +55 -0
- bluer_objects/README/process/objects.py +32 -0
- bluer_objects/README/process/signature.py +35 -0
- bluer_objects/README/process/title.py +44 -0
- bluer_objects/README/process/variables.py +12 -0
- bluer_objects/__init__.py +1 -1
- bluer_objects/assets/__init__.py +0 -0
- bluer_objects/assets/__main__.py +57 -0
- bluer_objects/assets/functions.py +62 -0
- bluer_objects/config.env +13 -1
- bluer_objects/env.py +27 -1
- bluer_objects/file/__main__.py +52 -7
- bluer_objects/file/functions.py +21 -4
- bluer_objects/file/load.py +2 -9
- bluer_objects/file/save.py +17 -24
- bluer_objects/graphics/__main__.py +7 -0
- bluer_objects/graphics/gif.py +11 -7
- bluer_objects/graphics/screen.py +9 -8
- bluer_objects/help/assets.py +93 -0
- bluer_objects/help/create_test_asset.py +22 -0
- bluer_objects/help/download.py +17 -3
- bluer_objects/help/file.py +59 -0
- bluer_objects/help/functions.py +9 -1
- bluer_objects/help/gif.py +25 -0
- bluer_objects/help/host.py +6 -4
- bluer_objects/help/ls.py +26 -3
- bluer_objects/help/metadata.py +51 -0
- bluer_objects/help/mlflow/__init__.py +23 -2
- bluer_objects/help/mlflow/cache.py +2 -4
- bluer_objects/help/mlflow/lock.py +52 -0
- bluer_objects/help/mlflow/tags.py +34 -23
- bluer_objects/help/pdf.py +67 -0
- bluer_objects/help/upload.py +10 -3
- bluer_objects/host/functions.py +4 -1
- bluer_objects/logger/confusion_matrix.py +76 -0
- bluer_objects/logger/image.py +110 -0
- bluer_objects/logger/stitch.py +107 -0
- bluer_objects/markdown.py +8 -6
- bluer_objects/metadata/__init__.py +1 -0
- bluer_objects/metadata/flatten.py +27 -0
- bluer_objects/mlflow/__init__.py +1 -1
- bluer_objects/mlflow/__main__.py +49 -31
- bluer_objects/mlflow/lock/__init__.py +1 -0
- bluer_objects/mlflow/lock/__main__.py +58 -0
- bluer_objects/mlflow/lock/functions.py +121 -0
- bluer_objects/mlflow/logging.py +53 -41
- bluer_objects/mlflow/models.py +7 -0
- bluer_objects/mlflow/objects.py +7 -0
- bluer_objects/mlflow/runs.py +10 -1
- bluer_objects/mlflow/serverless/__init__.py +3 -0
- bluer_objects/mlflow/serverless/api.py +88 -0
- bluer_objects/mlflow/serverless/read.py +19 -0
- bluer_objects/mlflow/serverless/search.py +35 -0
- bluer_objects/mlflow/serverless/write.py +42 -0
- bluer_objects/mlflow/tags.py +59 -9
- bluer_objects/objects.py +3 -1
- bluer_objects/pdf/__init__.py +1 -0
- bluer_objects/pdf/__main__.py +78 -0
- bluer_objects/pdf/convert/__init__.py +0 -0
- bluer_objects/pdf/convert/batch.py +54 -0
- bluer_objects/pdf/convert/combination.py +32 -0
- bluer_objects/pdf/convert/convert.py +110 -0
- bluer_objects/pdf/convert/image.py +53 -0
- bluer_objects/pdf/convert/md.py +97 -0
- bluer_objects/pdf/convert/missing.py +96 -0
- bluer_objects/pdf/convert/pdf.py +37 -0
- bluer_objects/sample.env +6 -0
- bluer_objects/storage/WebDAV.py +11 -7
- bluer_objects/storage/WebDAVrequest.py +360 -0
- bluer_objects/storage/WebDAVzip.py +26 -29
- bluer_objects/storage/__init__.py +28 -1
- bluer_objects/storage/__main__.py +40 -6
- bluer_objects/storage/base.py +84 -5
- bluer_objects/storage/policies.py +7 -0
- bluer_objects/storage/s3.py +367 -0
- bluer_objects/testing/__main__.py +6 -0
- bluer_objects/tests/test_README_consts.py +71 -0
- bluer_objects/tests/test_README_items.py +128 -0
- bluer_objects/tests/test_alias.py +33 -0
- bluer_objects/tests/test_env.py +42 -7
- bluer_objects/tests/test_file_download.py +30 -0
- bluer_objects/tests/test_file_load_save.py +1 -2
- bluer_objects/tests/test_file_load_save_text.py +46 -0
- bluer_objects/tests/test_graphics_gif.py +2 -0
- bluer_objects/tests/test_log_image_grid.py +29 -0
- bluer_objects/tests/test_logger_confusion_matrix.py +18 -0
- bluer_objects/tests/test_logger_matrix.py +2 -2
- bluer_objects/tests/test_logger_stitch_images.py +47 -0
- bluer_objects/tests/test_metadata.py +12 -6
- bluer_objects/tests/test_metadata_flatten.py +109 -0
- bluer_objects/tests/test_mlflow.py +114 -5
- bluer_objects/tests/test_mlflow_lock.py +26 -0
- bluer_objects/tests/test_objects.py +2 -0
- bluer_objects/tests/test_shell.py +34 -0
- bluer_objects/tests/test_storage.py +8 -21
- bluer_objects/tests/test_storage_base.py +39 -0
- bluer_objects/tests/test_storage_s3.py +67 -0
- bluer_objects/tests/test_storage_webdav_request.py +75 -0
- bluer_objects/tests/test_storage_webdav_zip.py +42 -0
- bluer_objects/tests/test_web_is_accessible.py +11 -0
- {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/METADATA +20 -11
- bluer_objects-6.464.1.dist-info/RECORD +228 -0
- {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/WHEEL +1 -1
- bluer_objects/.abcli/storage/download_file.sh +0 -9
- bluer_objects/.abcli/storage/exists.sh +0 -8
- bluer_objects/.abcli/storage/list.sh +0 -8
- bluer_objects/.abcli/storage/rm.sh +0 -11
- bluer_objects/.abcli/tests/mlflow_test.sh +0 -7
- bluer_objects-6.104.1.dist-info/RECORD +0 -143
- {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/licenses/LICENSE +0 -0
- {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/top_level.txt +0 -0
bluer_objects/file/save.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any, Dict, List
|
|
1
|
+
from typing import Any, Dict, List, Union
|
|
2
2
|
import yaml
|
|
3
3
|
import numpy as np
|
|
4
4
|
import json
|
|
@@ -13,7 +13,6 @@ from bluer_options.host import is_jupyter
|
|
|
13
13
|
from bluer_objects import NAME
|
|
14
14
|
from bluer_objects.file.classes import JsonEncoder
|
|
15
15
|
from bluer_objects.file.functions import path as file_path
|
|
16
|
-
from bluer_objects.file.load import load_text
|
|
17
16
|
from bluer_objects.path import create as path_create
|
|
18
17
|
from bluer_objects.logger import logger
|
|
19
18
|
|
|
@@ -31,9 +30,15 @@ def finish_saving(
|
|
|
31
30
|
success: bool,
|
|
32
31
|
message: str,
|
|
33
32
|
log: bool = True,
|
|
33
|
+
exception: Union[Exception, None] = None,
|
|
34
34
|
) -> bool:
|
|
35
35
|
if not success:
|
|
36
|
-
crash_report(
|
|
36
|
+
crash_report(
|
|
37
|
+
"{}: failed: {}".format(
|
|
38
|
+
message,
|
|
39
|
+
exception,
|
|
40
|
+
)
|
|
41
|
+
)
|
|
37
42
|
elif log:
|
|
38
43
|
logger.info(message)
|
|
39
44
|
|
|
@@ -105,9 +110,9 @@ def save_fig(
|
|
|
105
110
|
try:
|
|
106
111
|
import matplotlib.pyplot as plt
|
|
107
112
|
|
|
113
|
+
plt.savefig(filename, bbox_inches="tight")
|
|
108
114
|
if is_jupyter():
|
|
109
115
|
plt.show()
|
|
110
|
-
plt.savefig(filename, bbox_inches="tight")
|
|
111
116
|
plt.close()
|
|
112
117
|
except:
|
|
113
118
|
success = False
|
|
@@ -137,7 +142,9 @@ def save_image(
|
|
|
137
142
|
data = np.flip(data, axis=2)
|
|
138
143
|
|
|
139
144
|
cv2.imwrite(filename, data)
|
|
140
|
-
except:
|
|
145
|
+
except Exception as e:
|
|
146
|
+
if log:
|
|
147
|
+
logger.error(e)
|
|
141
148
|
success = False
|
|
142
149
|
|
|
143
150
|
return finish_saving(
|
|
@@ -214,32 +221,15 @@ def save_matrix(
|
|
|
214
221
|
def save_text(
|
|
215
222
|
filename: str,
|
|
216
223
|
text: List[str],
|
|
217
|
-
if_different: bool = False,
|
|
218
224
|
log: bool = False,
|
|
219
|
-
remove_empty_lines: bool = False,
|
|
220
225
|
) -> bool:
|
|
221
|
-
if remove_empty_lines:
|
|
222
|
-
text = [
|
|
223
|
-
line
|
|
224
|
-
for line, next_line in zip(text, text[1:] + ["x"])
|
|
225
|
-
if line.strip() or next_line.strip()
|
|
226
|
-
]
|
|
227
|
-
|
|
228
|
-
if if_different:
|
|
229
|
-
_, content = load_text(filename, ignore_error=True)
|
|
230
|
-
|
|
231
|
-
if "|".join([line for line in content if line]) == "|".join(
|
|
232
|
-
[line for line in text if line]
|
|
233
|
-
):
|
|
234
|
-
return True
|
|
235
|
-
|
|
236
226
|
if not prepare_for_saving(filename):
|
|
237
227
|
return False
|
|
238
228
|
|
|
239
229
|
success = True
|
|
240
230
|
try:
|
|
241
231
|
with open(filename, "w") as fp:
|
|
242
|
-
fp.writelines(
|
|
232
|
+
fp.writelines(string + "\n" for string in text)
|
|
243
233
|
except:
|
|
244
234
|
success = False
|
|
245
235
|
|
|
@@ -262,12 +252,14 @@ def save_yaml(
|
|
|
262
252
|
if not prepare_for_saving(filename):
|
|
263
253
|
return False
|
|
264
254
|
|
|
255
|
+
exception = None
|
|
265
256
|
success = True
|
|
266
257
|
try:
|
|
267
258
|
with open(filename, "w") as f:
|
|
268
259
|
yaml.dump(data, f)
|
|
269
|
-
except:
|
|
260
|
+
except Exception as e:
|
|
270
261
|
success = False
|
|
262
|
+
exception = e
|
|
271
263
|
|
|
272
264
|
return finish_saving(
|
|
273
265
|
success,
|
|
@@ -277,4 +269,5 @@ def save_yaml(
|
|
|
277
269
|
filename,
|
|
278
270
|
),
|
|
279
271
|
log,
|
|
272
|
+
exception,
|
|
280
273
|
)
|
|
@@ -34,6 +34,12 @@ parser.add_argument(
|
|
|
34
34
|
type=str,
|
|
35
35
|
help="blank: <object-name>.gif",
|
|
36
36
|
)
|
|
37
|
+
parser.add_argument(
|
|
38
|
+
"--frame_count",
|
|
39
|
+
default=-1,
|
|
40
|
+
type=int,
|
|
41
|
+
help="-1: all",
|
|
42
|
+
)
|
|
37
43
|
parser.add_argument(
|
|
38
44
|
"--frame_duration",
|
|
39
45
|
default=150,
|
|
@@ -72,6 +78,7 @@ if args.task == "generate_animated_gif":
|
|
|
72
78
|
),
|
|
73
79
|
object_name=args.object_name,
|
|
74
80
|
),
|
|
81
|
+
frame_count=args.frame_count,
|
|
75
82
|
frame_duration=args.frame_duration,
|
|
76
83
|
scale=args.scale,
|
|
77
84
|
)
|
bluer_objects/graphics/gif.py
CHANGED
|
@@ -15,6 +15,7 @@ NAME = module.name(__file__, NAME)
|
|
|
15
15
|
def generate_animated_gif(
|
|
16
16
|
list_of_images: List[str],
|
|
17
17
|
output_filename: str,
|
|
18
|
+
frame_count: int = -1,
|
|
18
19
|
frame_duration: int = 150,
|
|
19
20
|
scale: int = 1,
|
|
20
21
|
log: bool = True,
|
|
@@ -22,17 +23,19 @@ def generate_animated_gif(
|
|
|
22
23
|
if not list_of_images:
|
|
23
24
|
return True
|
|
24
25
|
|
|
26
|
+
if frame_count != -1:
|
|
27
|
+
list_of_images = list_of_images[:frame_count]
|
|
28
|
+
|
|
25
29
|
max_width = 0
|
|
26
30
|
max_height = 0
|
|
27
31
|
frames = []
|
|
28
32
|
for filename in tqdm(list_of_images):
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
frames.append(image)
|
|
33
|
+
with Image.open(filename) as image:
|
|
34
|
+
frames.append(image.copy())
|
|
32
35
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
width, height = image.size
|
|
37
|
+
max_width = max(max_width, width)
|
|
38
|
+
max_height = max(max_height, height)
|
|
36
39
|
|
|
37
40
|
padded_frames = []
|
|
38
41
|
for image in frames:
|
|
@@ -67,7 +70,7 @@ def generate_animated_gif(
|
|
|
67
70
|
except Exception:
|
|
68
71
|
success = False
|
|
69
72
|
|
|
70
|
-
message = "{}.generate_animated_gif({}x{}x{}) -scale={}-> {} @ {:.2f}ms".format(
|
|
73
|
+
message = "{}.generate_animated_gif({}x{}x{}) -scale={}-> {} @ {:.2f}ms{}".format(
|
|
71
74
|
NAME,
|
|
72
75
|
len(list_of_images),
|
|
73
76
|
height,
|
|
@@ -75,6 +78,7 @@ def generate_animated_gif(
|
|
|
75
78
|
scale,
|
|
76
79
|
output_filename,
|
|
77
80
|
frame_duration,
|
|
81
|
+
"" if frame_count == -1 else " [{} frame(s)]".format(frame_count),
|
|
78
82
|
)
|
|
79
83
|
|
|
80
84
|
if success:
|
bluer_objects/graphics/screen.py
CHANGED
|
@@ -24,14 +24,15 @@ def get_size() -> Tuple[int, int]:
|
|
|
24
24
|
screen_height = 480
|
|
25
25
|
screen_width = 640
|
|
26
26
|
|
|
27
|
-
if is_rpi()
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
if is_rpi():
|
|
28
|
+
if not is_headless():
|
|
29
|
+
try:
|
|
30
|
+
# https://stackoverflow.com/a/14124257
|
|
31
|
+
screen = os.popen("xrandr -q -d :0").readlines()[0]
|
|
32
|
+
screen_width = int(screen.split()[7])
|
|
33
|
+
screen_height = int(screen.split()[9][:-1])
|
|
34
|
+
except Exception as e:
|
|
35
|
+
logger.error(f"{NAME}: Failed: {e}.")
|
|
35
36
|
elif is_mac():
|
|
36
37
|
success, output = shell(
|
|
37
38
|
"system_profiler SPDisplaysDataType | grep Resolution",
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from bluer_ai.help.git import push_options
|
|
4
|
+
from bluer_options.terminal import show_usage, xtra
|
|
5
|
+
|
|
6
|
+
from bluer_objects import env
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def help_cd(
|
|
10
|
+
tokens: List[str],
|
|
11
|
+
mono: bool,
|
|
12
|
+
) -> str:
|
|
13
|
+
options = "".join(
|
|
14
|
+
[
|
|
15
|
+
xtra("create,", mono=mono),
|
|
16
|
+
"vol=<{}>".format(env.BLUER_OBJECTS_DEFAULT_ASSETS_VOL),
|
|
17
|
+
]
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
return show_usage(
|
|
21
|
+
[
|
|
22
|
+
"@assets",
|
|
23
|
+
"cd",
|
|
24
|
+
f"[{options}]",
|
|
25
|
+
"[<path>]",
|
|
26
|
+
],
|
|
27
|
+
"cd assets volume.",
|
|
28
|
+
mono=mono,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def help_mv(
|
|
33
|
+
tokens: List[str],
|
|
34
|
+
mono: bool,
|
|
35
|
+
) -> str:
|
|
36
|
+
options = xtra("~create,extension=<jpg>,vol=<2>", mono=mono)
|
|
37
|
+
|
|
38
|
+
return show_usage(
|
|
39
|
+
[
|
|
40
|
+
"@assets",
|
|
41
|
+
"mv",
|
|
42
|
+
f"[{options}]",
|
|
43
|
+
"[<this/that>]",
|
|
44
|
+
"[push,{}]".format(
|
|
45
|
+
push_options(
|
|
46
|
+
mono=mono,
|
|
47
|
+
uses_actions=False,
|
|
48
|
+
uses_pull_request=False,
|
|
49
|
+
uses_workflows=False,
|
|
50
|
+
)
|
|
51
|
+
),
|
|
52
|
+
],
|
|
53
|
+
"mv assets to volume.",
|
|
54
|
+
mono=mono,
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def help_publish(
|
|
59
|
+
tokens: List[str],
|
|
60
|
+
mono: bool,
|
|
61
|
+
) -> str:
|
|
62
|
+
options = "".join(
|
|
63
|
+
[
|
|
64
|
+
xtra("download,", mono=mono),
|
|
65
|
+
"extensions=<png+txt>",
|
|
66
|
+
xtra(",~pull,", mono=mono),
|
|
67
|
+
"push",
|
|
68
|
+
]
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
args = [
|
|
72
|
+
"[--asset_name <other-object-name>]",
|
|
73
|
+
"[--prefix <prefix>]",
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
return show_usage(
|
|
77
|
+
[
|
|
78
|
+
"@assets",
|
|
79
|
+
"publish",
|
|
80
|
+
f"[{options}]",
|
|
81
|
+
"[.|<object-name>]",
|
|
82
|
+
]
|
|
83
|
+
+ args,
|
|
84
|
+
"<object-name>/<prefix> -> assets.",
|
|
85
|
+
mono=mono,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
help_functions = {
|
|
90
|
+
"cd": help_cd,
|
|
91
|
+
"mv": help_mv,
|
|
92
|
+
"publish": help_publish,
|
|
93
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from bluer_options.terminal import show_usage
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def help_create_test_asset(
|
|
7
|
+
tokens: List[str],
|
|
8
|
+
mono: bool,
|
|
9
|
+
) -> str:
|
|
10
|
+
args = [
|
|
11
|
+
"[--depth 10]",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
return show_usage(
|
|
15
|
+
[
|
|
16
|
+
"@create_test_asset",
|
|
17
|
+
"[.|<object-name>]",
|
|
18
|
+
]
|
|
19
|
+
+ args,
|
|
20
|
+
"create test asset.",
|
|
21
|
+
mono=mono,
|
|
22
|
+
)
|
bluer_objects/help/download.py
CHANGED
|
@@ -2,19 +2,33 @@ from typing import List
|
|
|
2
2
|
|
|
3
3
|
from bluer_options.terminal import show_usage, xtra
|
|
4
4
|
|
|
5
|
+
from bluer_objects.storage.policies import DownloadPolicy
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def options(mono: bool) -> str:
|
|
9
|
+
return "".join(
|
|
10
|
+
[
|
|
11
|
+
"filename=<filename>",
|
|
12
|
+
xtra(
|
|
13
|
+
",policy={}".format(
|
|
14
|
+
"|".join(sorted([policy.name.lower() for policy in DownloadPolicy]))
|
|
15
|
+
),
|
|
16
|
+
mono=mono,
|
|
17
|
+
),
|
|
18
|
+
]
|
|
19
|
+
)
|
|
20
|
+
|
|
5
21
|
|
|
6
22
|
def help_download(
|
|
7
23
|
tokens: List[str],
|
|
8
24
|
mono: bool,
|
|
9
25
|
) -> str:
|
|
10
|
-
options = "filename=<filename>"
|
|
11
|
-
|
|
12
26
|
open_options = "open,QGIS"
|
|
13
27
|
|
|
14
28
|
return show_usage(
|
|
15
29
|
[
|
|
16
30
|
"@download",
|
|
17
|
-
f"[{options}]",
|
|
31
|
+
f"[{options(mono=mono)}]",
|
|
18
32
|
"[.|<object-name>]",
|
|
19
33
|
f"[{open_options}]",
|
|
20
34
|
],
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
|
|
3
|
+
from bluer_options.terminal import show_usage, xtra
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def help_replace(
|
|
7
|
+
tokens: List[str],
|
|
8
|
+
mono: bool,
|
|
9
|
+
) -> str:
|
|
10
|
+
options = xtra("sudo", mono=mono)
|
|
11
|
+
|
|
12
|
+
args = [
|
|
13
|
+
"--cat 1",
|
|
14
|
+
"--save 0",
|
|
15
|
+
"--this this-1+this-2",
|
|
16
|
+
"--that that-1+that-2",
|
|
17
|
+
"--whole_line 1",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
return show_usage(
|
|
21
|
+
[
|
|
22
|
+
"@file",
|
|
23
|
+
f"[{options}]",
|
|
24
|
+
"replace",
|
|
25
|
+
"<filename>",
|
|
26
|
+
]
|
|
27
|
+
+ args,
|
|
28
|
+
"<this> -> <that> in <filename>.",
|
|
29
|
+
mono=mono,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def help_size(
|
|
34
|
+
tokens: List[str],
|
|
35
|
+
mono: bool,
|
|
36
|
+
) -> str:
|
|
37
|
+
options = "-"
|
|
38
|
+
|
|
39
|
+
args = [
|
|
40
|
+
"--pretty 0",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
return show_usage(
|
|
44
|
+
[
|
|
45
|
+
"@file",
|
|
46
|
+
f"[{options}]",
|
|
47
|
+
"size",
|
|
48
|
+
"<filename>",
|
|
49
|
+
]
|
|
50
|
+
+ args,
|
|
51
|
+
"size of <filename>",
|
|
52
|
+
mono=mono,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
help_functions = {
|
|
57
|
+
"replace": help_replace,
|
|
58
|
+
"size": help_size,
|
|
59
|
+
}
|
bluer_objects/help/functions.py
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
from bluer_ai.help.generic import help_functions as generic_help_functions
|
|
2
2
|
|
|
3
3
|
from bluer_objects import ALIAS
|
|
4
|
+
from bluer_objects.help.assets import help_functions as help_assets
|
|
4
5
|
from bluer_objects.help.clone import help_clone
|
|
6
|
+
from bluer_objects.help.create_test_asset import help_create_test_asset
|
|
5
7
|
from bluer_objects.help.download import help_download
|
|
6
|
-
from bluer_objects.help.gif import help_gif
|
|
8
|
+
from bluer_objects.help.gif import help_functions as help_gif
|
|
9
|
+
from bluer_objects.help.file import help_functions as help_file
|
|
7
10
|
from bluer_objects.help.host import help_functions as help_host
|
|
8
11
|
from bluer_objects.help.ls import help_ls
|
|
9
12
|
from bluer_objects.help.metadata import help_functions as help_metadata
|
|
10
13
|
from bluer_objects.help.mlflow import help_functions as help_mlflow
|
|
14
|
+
from bluer_objects.help.pdf import help_functions as help_pdf
|
|
11
15
|
from bluer_objects.help.upload import help_upload
|
|
12
16
|
|
|
13
17
|
help_functions = generic_help_functions(plugin_name=ALIAS)
|
|
14
18
|
|
|
15
19
|
help_functions.update(
|
|
16
20
|
{
|
|
21
|
+
"assets": help_assets,
|
|
17
22
|
"clone": help_clone,
|
|
23
|
+
"create_test_asset": help_create_test_asset,
|
|
18
24
|
"download": help_download,
|
|
25
|
+
"file": help_file,
|
|
19
26
|
"gif": help_gif,
|
|
20
27
|
"host": help_host,
|
|
21
28
|
"ls": help_ls,
|
|
22
29
|
"metadata": help_metadata,
|
|
23
30
|
"mlflow": help_mlflow,
|
|
31
|
+
"pdf": help_pdf,
|
|
24
32
|
"upload": help_upload,
|
|
25
33
|
}
|
|
26
34
|
)
|
bluer_objects/help/gif.py
CHANGED
|
@@ -10,6 +10,7 @@ def help_gif(
|
|
|
10
10
|
options = xtra("~download,dryrun,~upload", mono=mono)
|
|
11
11
|
|
|
12
12
|
args = [
|
|
13
|
+
"[--frame_count <100>]",
|
|
13
14
|
"[--frame_duration <150>]",
|
|
14
15
|
"[--output_filename <object-name>.gif]",
|
|
15
16
|
"[--scale <1>]",
|
|
@@ -26,3 +27,27 @@ def help_gif(
|
|
|
26
27
|
"generate <object-name>.gif.",
|
|
27
28
|
mono=mono,
|
|
28
29
|
)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def help_gif_open(
|
|
33
|
+
tokens: List[str],
|
|
34
|
+
mono: bool,
|
|
35
|
+
) -> str:
|
|
36
|
+
options = xtra("download,filename=<filename.gif>", mono=mono)
|
|
37
|
+
|
|
38
|
+
return show_usage(
|
|
39
|
+
[
|
|
40
|
+
"@gif",
|
|
41
|
+
"open",
|
|
42
|
+
f"[{options}]",
|
|
43
|
+
"[.|<object-name>]",
|
|
44
|
+
],
|
|
45
|
+
"open <object-name>.gif.",
|
|
46
|
+
mono=mono,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
help_functions = {
|
|
51
|
+
"": help_gif,
|
|
52
|
+
"open": help_gif_open,
|
|
53
|
+
}
|
bluer_objects/help/host.py
CHANGED
|
@@ -24,15 +24,16 @@ def help_reboot(
|
|
|
24
24
|
tokens: List[str],
|
|
25
25
|
mono: bool,
|
|
26
26
|
) -> str:
|
|
27
|
-
options = xtra("dryrun", mono=mono)
|
|
27
|
+
options = xtra("dryrun,rpi", mono=mono)
|
|
28
28
|
|
|
29
29
|
return show_usage(
|
|
30
30
|
[
|
|
31
31
|
"@host",
|
|
32
32
|
"reboot",
|
|
33
33
|
f"[{options}]",
|
|
34
|
+
"[<machine-name>]",
|
|
34
35
|
],
|
|
35
|
-
"reboot
|
|
36
|
+
"reboot.",
|
|
36
37
|
mono=mono,
|
|
37
38
|
)
|
|
38
39
|
|
|
@@ -41,15 +42,16 @@ def help_shutdown(
|
|
|
41
42
|
tokens: List[str],
|
|
42
43
|
mono: bool,
|
|
43
44
|
) -> str:
|
|
44
|
-
options = xtra("dryrun", mono=mono)
|
|
45
|
+
options = xtra("dryrun,rpi", mono=mono)
|
|
45
46
|
|
|
46
47
|
return show_usage(
|
|
47
48
|
[
|
|
48
49
|
"@host",
|
|
49
50
|
"shutdown",
|
|
50
51
|
f"[{options}]",
|
|
52
|
+
"[<machine-name>]",
|
|
51
53
|
],
|
|
52
|
-
"shutdown
|
|
54
|
+
"shutdown.",
|
|
53
55
|
mono=mono,
|
|
54
56
|
)
|
|
55
57
|
|
bluer_objects/help/ls.py
CHANGED
|
@@ -15,26 +15,49 @@ def help_ls(
|
|
|
15
15
|
usage_1 = show_usage(
|
|
16
16
|
[
|
|
17
17
|
"@ls",
|
|
18
|
-
"cloud
|
|
19
|
-
"
|
|
18
|
+
"[cloud|local]",
|
|
19
|
+
"[.|<object-name>]",
|
|
20
20
|
]
|
|
21
21
|
+ args,
|
|
22
22
|
"ls <object-name>.",
|
|
23
23
|
mono=mono,
|
|
24
24
|
)
|
|
25
25
|
|
|
26
|
+
# ---
|
|
27
|
+
|
|
28
|
+
args = [
|
|
29
|
+
"[--delim <space>]",
|
|
30
|
+
"[--log <0>]",
|
|
31
|
+
"[--prefix <prefix>]",
|
|
32
|
+
]
|
|
33
|
+
|
|
26
34
|
usage_2 = show_usage(
|
|
27
35
|
[
|
|
28
36
|
"@ls",
|
|
29
|
-
"
|
|
37
|
+
"[cloud|local,objects]",
|
|
38
|
+
]
|
|
39
|
+
+ args,
|
|
40
|
+
"ls objects.",
|
|
41
|
+
mono=mono,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# ---
|
|
45
|
+
|
|
46
|
+
usage_3 = show_usage(
|
|
47
|
+
[
|
|
48
|
+
"@ls",
|
|
49
|
+
"[<path>]",
|
|
30
50
|
],
|
|
31
51
|
"ls <path>.",
|
|
32
52
|
mono=mono,
|
|
33
53
|
)
|
|
34
54
|
|
|
55
|
+
# ---
|
|
56
|
+
|
|
35
57
|
return "\n".join(
|
|
36
58
|
[
|
|
37
59
|
usage_1,
|
|
38
60
|
usage_2,
|
|
61
|
+
usage_3,
|
|
39
62
|
]
|
|
40
63
|
)
|
bluer_objects/help/metadata.py
CHANGED
|
@@ -3,6 +3,39 @@ from typing import List
|
|
|
3
3
|
from bluer_options.terminal import show_usage, xtra
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
def help_download(
|
|
7
|
+
tokens: List[str],
|
|
8
|
+
mono: bool,
|
|
9
|
+
) -> str:
|
|
10
|
+
return show_usage(
|
|
11
|
+
[
|
|
12
|
+
"@metadata",
|
|
13
|
+
"download",
|
|
14
|
+
"[. | <object-name>]",
|
|
15
|
+
],
|
|
16
|
+
"download <object-name>/metadata",
|
|
17
|
+
mono=mono,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def help_edit(
|
|
22
|
+
tokens: List[str],
|
|
23
|
+
mono: bool,
|
|
24
|
+
) -> str:
|
|
25
|
+
options = "download"
|
|
26
|
+
|
|
27
|
+
return show_usage(
|
|
28
|
+
[
|
|
29
|
+
"@metadata",
|
|
30
|
+
"edit",
|
|
31
|
+
f"[{options}]",
|
|
32
|
+
"[.|<object-name>]",
|
|
33
|
+
],
|
|
34
|
+
"edit <object-name>/metadata",
|
|
35
|
+
mono=mono,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
def help_get(
|
|
7
40
|
tokens: List[str],
|
|
8
41
|
mono: bool,
|
|
@@ -146,7 +179,25 @@ def help_post(
|
|
|
146
179
|
)
|
|
147
180
|
|
|
148
181
|
|
|
182
|
+
def help_upload(
|
|
183
|
+
tokens: List[str],
|
|
184
|
+
mono: bool,
|
|
185
|
+
) -> str:
|
|
186
|
+
return show_usage(
|
|
187
|
+
[
|
|
188
|
+
"@metadata",
|
|
189
|
+
"upload",
|
|
190
|
+
"[. | <object-name>]",
|
|
191
|
+
],
|
|
192
|
+
"upload <object-name>/metadata",
|
|
193
|
+
mono=mono,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
|
|
149
197
|
help_functions = {
|
|
198
|
+
"download": help_download,
|
|
199
|
+
"edit": help_edit,
|
|
150
200
|
"get": help_get,
|
|
151
201
|
"post": help_post,
|
|
202
|
+
"upload": help_upload,
|
|
152
203
|
}
|
|
@@ -3,6 +3,7 @@ from typing import List
|
|
|
3
3
|
from bluer_options.terminal import show_usage, xtra
|
|
4
4
|
|
|
5
5
|
from bluer_objects.help.mlflow.cache import help_functions as help_cache
|
|
6
|
+
from bluer_objects.help.mlflow.lock import help_functions as help_lock
|
|
6
7
|
from bluer_objects.help.mlflow.tags import help_functions as help_tags
|
|
7
8
|
from bluer_ai import env
|
|
8
9
|
|
|
@@ -29,7 +30,7 @@ def help_deploy(
|
|
|
29
30
|
tokens: List[str],
|
|
30
31
|
mono: bool,
|
|
31
32
|
) -> str:
|
|
32
|
-
options = xtra("dryrun
|
|
33
|
+
options = xtra("dryrun,port=<5001>", mono=mono)
|
|
33
34
|
|
|
34
35
|
return show_usage(
|
|
35
36
|
[
|
|
@@ -42,6 +43,22 @@ def help_deploy(
|
|
|
42
43
|
)
|
|
43
44
|
|
|
44
45
|
|
|
46
|
+
def help_deploy_set(
|
|
47
|
+
tokens: List[str],
|
|
48
|
+
mono: bool,
|
|
49
|
+
) -> str:
|
|
50
|
+
return show_usage(
|
|
51
|
+
[
|
|
52
|
+
"@mlflow",
|
|
53
|
+
"deploy",
|
|
54
|
+
"set",
|
|
55
|
+
"<url> | local",
|
|
56
|
+
],
|
|
57
|
+
"set mlflow deployment.",
|
|
58
|
+
mono=mono,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
45
62
|
def help_get_id(
|
|
46
63
|
tokens: List[str],
|
|
47
64
|
mono: bool,
|
|
@@ -198,10 +215,14 @@ def help_transition(
|
|
|
198
215
|
help_functions = {
|
|
199
216
|
"browse": help_browse,
|
|
200
217
|
"cache": help_cache,
|
|
201
|
-
"deploy":
|
|
218
|
+
"deploy": {
|
|
219
|
+
"": help_deploy,
|
|
220
|
+
"set": help_deploy_set,
|
|
221
|
+
},
|
|
202
222
|
"get_id": help_get_id,
|
|
203
223
|
"get_run_id": help_get_run_id,
|
|
204
224
|
"list_registered_models": help_list_registered_models,
|
|
225
|
+
"lock": help_lock,
|
|
205
226
|
"log_artifacts": help_log_artifacts,
|
|
206
227
|
"log_run": help_log_run,
|
|
207
228
|
"rm": help_rm,
|