halib 0.1.93__tar.gz → 0.1.94__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.93 → halib-0.1.94}/PKG-INFO +2 -2
- {halib-0.1.93 → halib-0.1.94}/README.md +1 -1
- {halib-0.1.93 → halib-0.1.94}/halib/common.py +53 -10
- {halib-0.1.93 → halib-0.1.94}/halib.egg-info/PKG-INFO +2 -2
- {halib-0.1.93 → halib-0.1.94}/setup.py +1 -1
- {halib-0.1.93 → halib-0.1.94}/.gitignore +0 -0
- {halib-0.1.93 → halib-0.1.94}/GDriveFolder.txt +0 -0
- {halib-0.1.93 → halib-0.1.94}/LICENSE.txt +0 -0
- {halib-0.1.93 → halib-0.1.94}/MANIFEST.in +0 -0
- {halib-0.1.93 → halib-0.1.94}/guide_publish_pip.pdf +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/__init__.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/cuda.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/filetype/__init__.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/filetype/csvfile.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/filetype/jsonfile.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/filetype/textfile.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/filetype/videofile.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/filetype/yamlfile.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/online/__init__.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/online/gdrive.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/online/gdrive_mkdir.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/online/gdrive_test.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/online/projectmake.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/__init__.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/base_config.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/base_exp.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/dataset.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/metrics.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/mics.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/params_gen.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/perfcalc.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/perftb.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/plot.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/profiler.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/torchloader.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/research/wandb_op.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/rich_color.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/system/__init__.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/system/cmd.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/system/filesys.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/utils/__init__.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/utils/dataclass_util.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/utils/dict_op.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/utils/gpu_mon.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/utils/listop.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/utils/tele_noti.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib/utils/video.py +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib.egg-info/SOURCES.txt +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib.egg-info/dependency_links.txt +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib.egg-info/requires.txt +0 -0
- {halib-0.1.93 → halib-0.1.94}/halib.egg-info/top_level.txt +0 -0
- {halib-0.1.93 → halib-0.1.94}/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.94
|
|
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.94**
|
|
56
56
|
+ `research/plot': add `PlotHelper` class to plot train history + plot grid of images (e.g., image samples from dataset or model outputs)
|
|
57
57
|
|
|
58
58
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
import re
|
|
2
3
|
import rich
|
|
3
4
|
import arrow
|
|
@@ -9,6 +10,8 @@ from rich import print
|
|
|
9
10
|
from rich.panel import Panel
|
|
10
11
|
from rich.console import Console
|
|
11
12
|
from rich.pretty import pprint, Pretty
|
|
13
|
+
from pathlib import PureWindowsPath
|
|
14
|
+
|
|
12
15
|
|
|
13
16
|
console = Console()
|
|
14
17
|
|
|
@@ -91,18 +94,58 @@ class ConsoleLog:
|
|
|
91
94
|
print(f"Exception message: {exc_value}")
|
|
92
95
|
|
|
93
96
|
|
|
94
|
-
def
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
def linux_to_wins_path(path: str) -> str:
|
|
98
|
+
"""
|
|
99
|
+
Convert a Linux-style WSL path (/mnt/c/... or /mnt/d/...) to a Windows-style path (C:\...).
|
|
100
|
+
"""
|
|
101
|
+
# Handle only /mnt/<drive>/... style
|
|
102
|
+
if (
|
|
103
|
+
path.startswith("/mnt/")
|
|
104
|
+
and len(path) > 6
|
|
105
|
+
and path[5].isalpha()
|
|
106
|
+
and path[6] == "/"
|
|
107
|
+
):
|
|
108
|
+
drive = path[5].upper() # Extract drive letter
|
|
109
|
+
win_path = f"{drive}:{path[6:]}" # Replace "/mnt/c/" with "C:/"
|
|
110
|
+
else:
|
|
111
|
+
win_path = path # Return unchanged if not a WSL-style path
|
|
112
|
+
# Normalize to Windows-style backslashes
|
|
113
|
+
return str(PureWindowsPath(win_path))
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
def pprint_local_path(
|
|
117
|
+
local_path: str, get_wins_path: bool = False, tag: str = ""
|
|
118
|
+
) -> str:
|
|
119
|
+
"""
|
|
120
|
+
Pretty-print a local path with emoji and clickable file:// URI.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
local_path: Path to file or directory (Linux or Windows style).
|
|
124
|
+
get_wins_path: If True on Linux, convert WSL-style path to Windows style before printing.
|
|
125
|
+
tag: Optional console log tag.
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
The file URI string.
|
|
129
|
+
"""
|
|
130
|
+
p = Path(local_path).resolve()
|
|
131
|
+
type_str = "📄" if p.is_file() else "📁" if p.is_dir() else "❓"
|
|
132
|
+
|
|
133
|
+
if get_wins_path and os.name == "posix":
|
|
134
|
+
# Try WSL → Windows conversion
|
|
135
|
+
converted = linux_to_wins_path(str(p))
|
|
136
|
+
if converted != str(p): # Conversion happened
|
|
137
|
+
file_uri = str(PureWindowsPath(converted).as_uri())
|
|
138
|
+
else:
|
|
139
|
+
file_uri = p.as_uri()
|
|
140
|
+
else:
|
|
141
|
+
file_uri = p.as_uri()
|
|
142
|
+
|
|
101
143
|
content_str = f"{type_str} [link={file_uri}]{file_uri}[/link]"
|
|
102
|
-
|
|
144
|
+
|
|
145
|
+
if tag:
|
|
103
146
|
with ConsoleLog(tag):
|
|
104
147
|
console.print(content_str)
|
|
105
148
|
else:
|
|
106
|
-
|
|
107
|
-
|
|
149
|
+
console.print(content_str)
|
|
150
|
+
|
|
108
151
|
return file_uri
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: halib
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.94
|
|
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.94**
|
|
56
56
|
+ `research/plot': add `PlotHelper` class to plot train history + plot grid of images (e.g., image samples from dataset or model outputs)
|
|
57
57
|
|
|
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
|
|
File without changes
|
|
File without changes
|