halib 0.1.81__tar.gz → 0.1.83__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.
- {halib-0.1.81 → halib-0.1.83}/PKG-INFO +2 -2
- {halib-0.1.81 → halib-0.1.83}/README.md +1 -1
- {halib-0.1.81 → halib-0.1.83}/halib/research/profiler.py +10 -8
- {halib-0.1.81 → halib-0.1.83}/halib.egg-info/PKG-INFO +2 -2
- {halib-0.1.81 → halib-0.1.83}/setup.py +1 -1
- {halib-0.1.81 → halib-0.1.83}/.gitignore +0 -0
- {halib-0.1.81 → halib-0.1.83}/GDriveFolder.txt +0 -0
- {halib-0.1.81 → halib-0.1.83}/LICENSE.txt +0 -0
- {halib-0.1.81 → halib-0.1.83}/MANIFEST.in +0 -0
- {halib-0.1.81 → halib-0.1.83}/guide_publish_pip.pdf +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/__init__.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/common.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/cuda.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/filetype/__init__.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/filetype/csvfile.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/filetype/jsonfile.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/filetype/textfile.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/filetype/videofile.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/filetype/yamlfile.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/online/__init__.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/online/gdrive.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/online/gdrive_mkdir.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/online/gdrive_test.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/online/projectmake.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/research/__init__.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/research/base_config.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/research/base_exp.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/research/dataset.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/research/metrics.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/research/perfcalc.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/research/perftb.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/research/plot.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/research/torchloader.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/research/wandb_op.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/rich_color.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/system/__init__.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/system/cmd.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/system/filesys.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/utils/__init__.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/utils/dataclass_util.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/utils/dict_op.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/utils/gpu_mon.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/utils/listop.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/utils/tele_noti.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib/utils/video.py +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib.egg-info/SOURCES.txt +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib.egg-info/dependency_links.txt +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib.egg-info/requires.txt +0 -0
- {halib-0.1.81 → halib-0.1.83}/halib.egg-info/top_level.txt +0 -0
- {halib-0.1.81 → halib-0.1.83}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: halib
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.83
|
4
4
|
Summary: Small library for common tasks
|
5
5
|
Author: Hoang Van Ha
|
6
6
|
Author-email: hoangvanhauit@gmail.com
|
@@ -52,7 +52,7 @@ Dynamic: summary
|
|
52
52
|
|
53
53
|
Helper package for coding and automation
|
54
54
|
|
55
|
-
**Version 0.1.
|
55
|
+
**Version 0.1.83**
|
56
56
|
|
57
57
|
+ `research/profiler`: add `zProfiler` class to measure execution time of contexts and steps, with support for dynamic color scales in plots.
|
58
58
|
|
@@ -95,7 +95,7 @@ class zProfiler:
|
|
95
95
|
│ }
|
96
96
|
"""
|
97
97
|
assert (
|
98
|
-
len(ctx_step_dict.keys()) >
|
98
|
+
len(ctx_step_dict.keys()) > 0
|
99
99
|
), "step_dict must have only one key (step_name) for detail."
|
100
100
|
|
101
101
|
for step_name, time_list in ctx_step_dict.items():
|
@@ -170,7 +170,7 @@ class zProfiler:
|
|
170
170
|
@classmethod
|
171
171
|
@classmethod
|
172
172
|
def plot_formatted_data(
|
173
|
-
cls, profiler_data, outdir=None, file_format="png", do_show=False
|
173
|
+
cls, profiler_data, outdir=None, file_format="png", do_show=False, tag=""
|
174
174
|
):
|
175
175
|
"""
|
176
176
|
Plot each context in a separate figure with bar + pie charts.
|
@@ -194,10 +194,11 @@ class zProfiler:
|
|
194
194
|
# pprint(f'{step_names=}')
|
195
195
|
n_steps = len(step_names)
|
196
196
|
|
197
|
+
assert n_steps > 0, "No steps found for context: {}".format(ctx)
|
197
198
|
# Generate dynamic colors
|
198
199
|
colors = px.colors.sample_colorscale(
|
199
200
|
"Viridis", [i / (n_steps - 1) for i in range(n_steps)]
|
200
|
-
)
|
201
|
+
) if n_steps > 1 else [px.colors.sample_colorscale("Viridis", [0])[0]]
|
201
202
|
# pprint(f'{len(colors)} colors generated for {n_steps} steps')
|
202
203
|
color_map = dict(zip(step_names, colors))
|
203
204
|
|
@@ -237,10 +238,10 @@ class zProfiler:
|
|
237
238
|
row=1,
|
238
239
|
col=2,
|
239
240
|
)
|
240
|
-
|
241
|
+
tag_str = f"[{tag}] " if tag else ""
|
241
242
|
# Layout
|
242
243
|
fig.update_layout(
|
243
|
-
title_text=f"Context Profiler: {ctx}",
|
244
|
+
title_text=f"[{tag_str}Context Profiler: {ctx}",
|
244
245
|
width=1000,
|
245
246
|
height=400,
|
246
247
|
showlegend=True,
|
@@ -257,7 +258,8 @@ class zProfiler:
|
|
257
258
|
|
258
259
|
# Save figure
|
259
260
|
if outdir is not None:
|
260
|
-
|
261
|
+
file_prefix = {ctx} if len(tag_str) == 0 else f"{tag_str}_{ctx}"
|
262
|
+
file_path = os.path.join(outdir, f"{file_prefix}_summary.{file_format.lower()}")
|
261
263
|
fig.write_image(file_path)
|
262
264
|
print(f"Saved figure: {file_path}")
|
263
265
|
|
@@ -265,7 +267,7 @@ class zProfiler:
|
|
265
267
|
|
266
268
|
return results
|
267
269
|
|
268
|
-
def report_and_plot(self, outdir=None, file_format="png", do_show=False):
|
270
|
+
def report_and_plot(self, outdir=None, file_format="png", do_show=False, tag=""):
|
269
271
|
"""
|
270
272
|
Generate the profiling report and plot the formatted data.
|
271
273
|
|
@@ -277,7 +279,7 @@ class zProfiler:
|
|
277
279
|
report = self.get_report_dict()
|
278
280
|
self.get_report_dict(with_detail=False)
|
279
281
|
return self.plot_formatted_data(
|
280
|
-
report, outdir=outdir, file_format=file_format, do_show=do_show
|
282
|
+
report, outdir=outdir, file_format=file_format, do_show=do_show, tag=tag
|
281
283
|
)
|
282
284
|
def meta_info(self):
|
283
285
|
"""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: halib
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.83
|
4
4
|
Summary: Small library for common tasks
|
5
5
|
Author: Hoang Van Ha
|
6
6
|
Author-email: hoangvanhauit@gmail.com
|
@@ -52,7 +52,7 @@ Dynamic: summary
|
|
52
52
|
|
53
53
|
Helper package for coding and automation
|
54
54
|
|
55
|
-
**Version 0.1.
|
55
|
+
**Version 0.1.83**
|
56
56
|
|
57
57
|
+ `research/profiler`: add `zProfiler` class to measure execution time of contexts and steps, with support for dynamic color scales in plots.
|
58
58
|
|
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
|