halib 0.1.96__tar.gz → 0.1.98__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.96 → halib-0.1.98}/PKG-INFO +6 -2
- {halib-0.1.96 → halib-0.1.98}/README.md +4 -1
- halib-0.1.98/halib/filetype/ipynb.py +63 -0
- {halib-0.1.96 → halib-0.1.98}/halib.egg-info/PKG-INFO +6 -2
- {halib-0.1.96 → halib-0.1.98}/halib.egg-info/SOURCES.txt +1 -0
- {halib-0.1.96 → halib-0.1.98}/halib.egg-info/requires.txt +1 -0
- {halib-0.1.96 → halib-0.1.98}/setup.py +1 -1
- {halib-0.1.96 → halib-0.1.98}/.gitignore +0 -0
- {halib-0.1.96 → halib-0.1.98}/GDriveFolder.txt +0 -0
- {halib-0.1.96 → halib-0.1.98}/LICENSE.txt +0 -0
- {halib-0.1.96 → halib-0.1.98}/MANIFEST.in +0 -0
- {halib-0.1.96 → halib-0.1.98}/guide_publish_pip.pdf +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/__init__.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/common.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/cuda.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/filetype/__init__.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/filetype/csvfile.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/filetype/jsonfile.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/filetype/textfile.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/filetype/videofile.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/filetype/yamlfile.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/online/__init__.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/online/gdrive.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/online/gdrive_mkdir.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/online/gdrive_test.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/online/projectmake.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/__init__.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/base_config.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/base_exp.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/dataset.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/flop_csv.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/flops.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/metrics.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/mics.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/params_gen.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/perfcalc.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/perftb.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/plot.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/profiler.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/torchloader.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/research/wandb_op.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/rich_color.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/system/__init__.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/system/cmd.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/system/filesys.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/utils/__init__.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/utils/dataclass_util.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/utils/dict_op.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/utils/gpu_mon.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/utils/listop.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/utils/tele_noti.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib/utils/video.py +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib.egg-info/dependency_links.txt +0 -0
- {halib-0.1.96 → halib-0.1.98}/halib.egg-info/top_level.txt +0 -0
- {halib-0.1.96 → halib-0.1.98}/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.98
|
|
4
4
|
Summary: Small library for common tasks
|
|
5
5
|
Author: Hoang Van Ha
|
|
6
6
|
Author-email: hoangvanhauit@gmail.com
|
|
@@ -40,6 +40,7 @@ Requires-Dist: timebudget
|
|
|
40
40
|
Requires-Dist: tqdm
|
|
41
41
|
Requires-Dist: tube_dl
|
|
42
42
|
Requires-Dist: wandb
|
|
43
|
+
Requires-Dist: ipynbname
|
|
43
44
|
Dynamic: author
|
|
44
45
|
Dynamic: author-email
|
|
45
46
|
Dynamic: classifier
|
|
@@ -52,8 +53,11 @@ Dynamic: summary
|
|
|
52
53
|
|
|
53
54
|
# Helper package for coding and automation
|
|
54
55
|
|
|
56
|
+
**Version 0.1.98**
|
|
57
|
+
+ `filetype/ipynb`: add `gen_ipynb_name` generator to create file name based on current notebook name as prefix (with optional timestamp)
|
|
58
|
+
|
|
55
59
|
**Version 0.1.96**
|
|
56
|
-
+ `research/plot
|
|
60
|
+
+ `research/plot`: add `PlotHelper` class to plot train history + plot grid of images (e.g., image samples from dataset or model outputs)
|
|
57
61
|
|
|
58
62
|
|
|
59
63
|
**Version 0.1.91**
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
# Helper package for coding and automation
|
|
2
2
|
|
|
3
|
+
**Version 0.1.98**
|
|
4
|
+
+ `filetype/ipynb`: add `gen_ipynb_name` generator to create file name based on current notebook name as prefix (with optional timestamp)
|
|
5
|
+
|
|
3
6
|
**Version 0.1.96**
|
|
4
|
-
+ `research/plot
|
|
7
|
+
+ `research/plot`: add `PlotHelper` class to plot train history + plot grid of images (e.g., image samples from dataset or model outputs)
|
|
5
8
|
|
|
6
9
|
|
|
7
10
|
**Version 0.1.91**
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from contextlib import contextmanager
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
import ipynbname
|
|
5
|
+
|
|
6
|
+
from ..common import console, now_str
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@contextmanager
|
|
10
|
+
def gen_ipynb_name(
|
|
11
|
+
filename,
|
|
12
|
+
add_time_stamp=False,
|
|
13
|
+
nb_prefix="nb__",
|
|
14
|
+
separator="__",
|
|
15
|
+
):
|
|
16
|
+
"""
|
|
17
|
+
Context manager that prefixes the filename with the notebook name.
|
|
18
|
+
Output: NotebookName_OriginalName.ext
|
|
19
|
+
"""
|
|
20
|
+
try:
|
|
21
|
+
nb_name = ipynbname.name()
|
|
22
|
+
except FileNotFoundError:
|
|
23
|
+
nb_name = "script" # Fallback
|
|
24
|
+
|
|
25
|
+
p = Path(filename)
|
|
26
|
+
|
|
27
|
+
# --- FIX START ---
|
|
28
|
+
|
|
29
|
+
# 1. Get the parts separately
|
|
30
|
+
original_stem = p.stem # "test" (no extension)
|
|
31
|
+
extension = p.suffix # ".csv"
|
|
32
|
+
|
|
33
|
+
now_string = now_str() if add_time_stamp else ""
|
|
34
|
+
|
|
35
|
+
# 2. Construct the base name (Notebook + Separator + OriginalName)
|
|
36
|
+
base_name = f"{nb_prefix}{nb_name}{separator}{original_stem}"
|
|
37
|
+
|
|
38
|
+
# 3. Append timestamp if needed
|
|
39
|
+
if now_string:
|
|
40
|
+
base_name = f"{base_name}{separator}{now_string}"
|
|
41
|
+
|
|
42
|
+
# 4. Add the extension at the VERY END
|
|
43
|
+
new_filename = f"{base_name}{extension}"
|
|
44
|
+
|
|
45
|
+
# --- FIX END ---
|
|
46
|
+
|
|
47
|
+
final_path = p.parent / new_filename
|
|
48
|
+
|
|
49
|
+
# Assuming you use 'rich' console based on your snippet
|
|
50
|
+
# console.rule()
|
|
51
|
+
# print(f"📝 Saving as: {final_path}")
|
|
52
|
+
|
|
53
|
+
yield str(final_path)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
if __name__ == "__main__":
|
|
57
|
+
# --- Usage Example ---
|
|
58
|
+
# Assume Notebook Name is: "MyThesisWork"
|
|
59
|
+
filename = "results.csv"
|
|
60
|
+
with gen_ipynb_name(filename) as filename_ipynb:
|
|
61
|
+
# filename_ipynb is now: "MyThesisWork_results.csv"
|
|
62
|
+
print(f"File to save: {filename_ipynb}")
|
|
63
|
+
# df.to_csv(filename_ipynb)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: halib
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.98
|
|
4
4
|
Summary: Small library for common tasks
|
|
5
5
|
Author: Hoang Van Ha
|
|
6
6
|
Author-email: hoangvanhauit@gmail.com
|
|
@@ -40,6 +40,7 @@ Requires-Dist: timebudget
|
|
|
40
40
|
Requires-Dist: tqdm
|
|
41
41
|
Requires-Dist: tube_dl
|
|
42
42
|
Requires-Dist: wandb
|
|
43
|
+
Requires-Dist: ipynbname
|
|
43
44
|
Dynamic: author
|
|
44
45
|
Dynamic: author-email
|
|
45
46
|
Dynamic: classifier
|
|
@@ -52,8 +53,11 @@ Dynamic: summary
|
|
|
52
53
|
|
|
53
54
|
# Helper package for coding and automation
|
|
54
55
|
|
|
56
|
+
**Version 0.1.98**
|
|
57
|
+
+ `filetype/ipynb`: add `gen_ipynb_name` generator to create file name based on current notebook name as prefix (with optional timestamp)
|
|
58
|
+
|
|
55
59
|
**Version 0.1.96**
|
|
56
|
-
+ `research/plot
|
|
60
|
+
+ `research/plot`: add `PlotHelper` class to plot train history + plot grid of images (e.g., image samples from dataset or model outputs)
|
|
57
61
|
|
|
58
62
|
|
|
59
63
|
**Version 0.1.91**
|
|
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
|