bluer-options 5.173.1__tar.gz → 5.180.1__tar.gz
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.
Potentially problematic release.
This version of bluer-options might be problematic. Click here for more details.
- {bluer_options-5.173.1/bluer_options.egg-info → bluer_options-5.180.1}/PKG-INFO +1 -1
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/__init__.py +1 -1
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/host/functions.py +6 -1
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/logger/config.py +9 -5
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/timing/classes.py +21 -3
- {bluer_options-5.173.1 → bluer_options-5.180.1/bluer_options.egg-info}/PKG-INFO +1 -1
- {bluer_options-5.173.1 → bluer_options-5.180.1}/LICENSE +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/MANIFEST.in +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/README.md +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/alias.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/assert.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/bluer_options.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/bool.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/browse.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/code.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/env/backup.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/env/dot/cat.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/env/dot/cp.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/env/dot/edit.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/env/dot/load.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/env/dot/seed.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/env/dot.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/env.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/eval.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/generic_task.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/help.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/install.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/list.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/logging.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/open.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/options.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/pause.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/plugins.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/pylint.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/pytest.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/repeat.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/seed.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/sleep.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/source.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/string.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/terminal.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/test.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/wait.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/.bash/watch.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/__main__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/assets/example1.sh +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/config.env +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/env/__init__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/env/functions.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/help/__init__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/help/__main__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/help/functions.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/help/parsing.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/host/__init__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/host/__main__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/list/__init__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/list/__main__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/logger/__init__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/logger/__main__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/logger/watch.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/options/__init__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/options/__main__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/options/classes.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/string/__init__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/string/__main__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/string/constants.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/string/functions.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/terminal/__init__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/terminal/__main__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/terminal/functions.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/timer.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/timing/__init__.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/timing/elapsed_timer.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options/urls.py +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options.egg-info/SOURCES.txt +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options.egg-info/dependency_links.txt +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options.egg-info/requires.txt +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/bluer_options.egg-info/top_level.txt +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/pyproject.toml +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/requirements.txt +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/setup.cfg +0 -0
- {bluer_options-5.173.1 → bluer_options-5.180.1}/setup.py +0 -0
|
@@ -2,6 +2,8 @@ from typing import List
|
|
|
2
2
|
import os
|
|
3
3
|
|
|
4
4
|
from blueness import module
|
|
5
|
+
from blueness import NAME as blueness_NAME
|
|
6
|
+
from blueness import VERSION as blueness_VERSION
|
|
5
7
|
from bluer_options import NAME, env, fullname, string
|
|
6
8
|
from bluer_options.logger import crash_report
|
|
7
9
|
|
|
@@ -128,7 +130,10 @@ def signature() -> List[str]:
|
|
|
128
130
|
import platform
|
|
129
131
|
|
|
130
132
|
return (
|
|
131
|
-
[
|
|
133
|
+
[
|
|
134
|
+
fullname(),
|
|
135
|
+
f"{blueness_NAME}-{blueness_VERSION}",
|
|
136
|
+
]
|
|
132
137
|
+ tensor_processing_signature()
|
|
133
138
|
+ [
|
|
134
139
|
"Python {}".format(platform.python_version()),
|
|
@@ -98,8 +98,12 @@ def log_list_as_str(
|
|
|
98
98
|
len(list_of_items),
|
|
99
99
|
item_name_plural,
|
|
100
100
|
", ".join(
|
|
101
|
-
list_of_items
|
|
102
|
-
|
|
101
|
+
list_of_items
|
|
102
|
+
if max_count == -1
|
|
103
|
+
else (
|
|
104
|
+
list_of_items[:max_count]
|
|
105
|
+
+ (["..."] if len(list_of_items) > max_count else [])
|
|
106
|
+
)
|
|
103
107
|
),
|
|
104
108
|
)
|
|
105
109
|
|
|
@@ -130,11 +134,11 @@ def log_list(
|
|
|
130
134
|
logger.info(
|
|
131
135
|
"#{: 4} - {}{}".format(
|
|
132
136
|
index,
|
|
133
|
-
item[:max_length],
|
|
134
|
-
"..." if len(item) > max_length else "",
|
|
137
|
+
item if max_length == -1 else item[:max_length],
|
|
138
|
+
"" if max_length == -1 else "..." if len(item) > max_length else "",
|
|
135
139
|
)
|
|
136
140
|
)
|
|
137
141
|
|
|
138
|
-
if index >= max_count - 1:
|
|
142
|
+
if max_count != -1 and index >= max_count - 1:
|
|
139
143
|
logger.info("...")
|
|
140
144
|
break
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import time
|
|
2
|
-
from typing import List
|
|
2
|
+
from typing import List, Dict
|
|
3
3
|
from collections import defaultdict
|
|
4
4
|
from functools import wraps
|
|
5
5
|
|
|
@@ -9,6 +9,12 @@ from bluer_options.logger.config import log_list
|
|
|
9
9
|
from bluer_options.timing.elapsed_timer import ElapsedTimer
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
def recursive_to_dict(d):
|
|
13
|
+
if isinstance(d, (defaultdict, dict)):
|
|
14
|
+
d = {k: recursive_to_dict(v) for k, v in d.items()}
|
|
15
|
+
return d
|
|
16
|
+
|
|
17
|
+
|
|
12
18
|
class Timing:
|
|
13
19
|
def __init__(self):
|
|
14
20
|
self._active = {}
|
|
@@ -30,7 +36,15 @@ class Timing:
|
|
|
30
36
|
|
|
31
37
|
return elapsed
|
|
32
38
|
|
|
39
|
+
@property
|
|
40
|
+
def as_dict(self) -> Dict:
|
|
41
|
+
self.calculate()
|
|
42
|
+
|
|
43
|
+
return recursive_to_dict(self.stats)
|
|
44
|
+
|
|
33
45
|
def as_list(self, **kwgrs) -> List[str]:
|
|
46
|
+
self.calculate()
|
|
47
|
+
|
|
34
48
|
lines = []
|
|
35
49
|
# sort items by total time (descending)
|
|
36
50
|
for k, v in sorted(
|
|
@@ -38,17 +52,20 @@ class Timing:
|
|
|
38
52
|
key=lambda item: item[1]["total"],
|
|
39
53
|
reverse=True,
|
|
40
54
|
):
|
|
41
|
-
avg = v["total"] / v["count"]
|
|
42
55
|
lines.append(
|
|
43
56
|
"{}: called {:,} time(s), total {}, avg {}".format(
|
|
44
57
|
k,
|
|
45
58
|
v["count"],
|
|
46
59
|
string.pretty_duration(v["total"], **kwgrs),
|
|
47
|
-
string.pretty_duration(
|
|
60
|
+
string.pretty_duration(v["average"], **kwgrs),
|
|
48
61
|
)
|
|
49
62
|
)
|
|
50
63
|
return lines
|
|
51
64
|
|
|
65
|
+
def calculate(self):
|
|
66
|
+
for v in self.stats.values():
|
|
67
|
+
v["average"] = v["total"] / v["count"]
|
|
68
|
+
|
|
52
69
|
def log(
|
|
53
70
|
self,
|
|
54
71
|
include_ms: bool = True,
|
|
@@ -72,6 +89,7 @@ class Timing:
|
|
|
72
89
|
short=short,
|
|
73
90
|
),
|
|
74
91
|
"function call(s):",
|
|
92
|
+
max_count=-1,
|
|
75
93
|
**kwargs,
|
|
76
94
|
)
|
|
77
95
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|