halib 0.2.9__tar.gz → 0.2.10__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.
Files changed (57) hide show
  1. halib-0.2.10/MANIFEST.in +5 -0
  2. {halib-0.2.9 → halib-0.2.10}/PKG-INFO +2 -2
  3. {halib-0.2.9 → halib-0.2.10}/README.md +1 -1
  4. halib-0.2.10/halib/system/_list_pc.csv +6 -0
  5. {halib-0.2.9 → halib-0.2.10}/halib/system/path.py +31 -19
  6. {halib-0.2.9 → halib-0.2.10}/halib.egg-info/PKG-INFO +2 -2
  7. {halib-0.2.9 → halib-0.2.10}/halib.egg-info/SOURCES.txt +1 -0
  8. {halib-0.2.9 → halib-0.2.10}/setup.py +2 -1
  9. halib-0.2.9/MANIFEST.in +0 -4
  10. {halib-0.2.9 → halib-0.2.10}/.gitignore +0 -0
  11. {halib-0.2.9 → halib-0.2.10}/GDriveFolder.txt +0 -0
  12. {halib-0.2.9 → halib-0.2.10}/LICENSE.txt +0 -0
  13. {halib-0.2.9 → halib-0.2.10}/halib/__init__.py +0 -0
  14. {halib-0.2.9 → halib-0.2.10}/halib/common/__init__.py +0 -0
  15. {halib-0.2.9 → halib-0.2.10}/halib/common/common.py +0 -0
  16. {halib-0.2.9 → halib-0.2.10}/halib/common/rich_color.py +0 -0
  17. {halib-0.2.9 → halib-0.2.10}/halib/exp/__init__.py +0 -0
  18. {halib-0.2.9 → halib-0.2.10}/halib/exp/core/__init__.py +0 -0
  19. {halib-0.2.9 → halib-0.2.10}/halib/exp/core/base_config.py +0 -0
  20. {halib-0.2.9 → halib-0.2.10}/halib/exp/core/base_exp.py +0 -0
  21. {halib-0.2.9 → halib-0.2.10}/halib/exp/core/param_gen.py +0 -0
  22. {halib-0.2.9 → halib-0.2.10}/halib/exp/core/wandb_op.py +0 -0
  23. {halib-0.2.9 → halib-0.2.10}/halib/exp/data/__init__.py +0 -0
  24. {halib-0.2.9 → halib-0.2.10}/halib/exp/data/dataclass_util.py +0 -0
  25. {halib-0.2.9 → halib-0.2.10}/halib/exp/data/dataset.py +0 -0
  26. {halib-0.2.9 → halib-0.2.10}/halib/exp/data/torchloader.py +0 -0
  27. {halib-0.2.9 → halib-0.2.10}/halib/exp/perf/__init__.py +0 -0
  28. {halib-0.2.9 → halib-0.2.10}/halib/exp/perf/flop_calc.py +0 -0
  29. {halib-0.2.9 → halib-0.2.10}/halib/exp/perf/gpu_mon.py +0 -0
  30. {halib-0.2.9 → halib-0.2.10}/halib/exp/perf/perfcalc.py +0 -0
  31. {halib-0.2.9 → halib-0.2.10}/halib/exp/perf/perfmetrics.py +0 -0
  32. {halib-0.2.9 → halib-0.2.10}/halib/exp/perf/perftb.py +0 -0
  33. {halib-0.2.9 → halib-0.2.10}/halib/exp/perf/profiler.py +0 -0
  34. {halib-0.2.9 → halib-0.2.10}/halib/exp/viz/__init__.py +0 -0
  35. {halib-0.2.9 → halib-0.2.10}/halib/exp/viz/plot.py +0 -0
  36. {halib-0.2.9 → halib-0.2.10}/halib/filetype/__init__.py +0 -0
  37. {halib-0.2.9 → halib-0.2.10}/halib/filetype/csvfile.py +0 -0
  38. {halib-0.2.9 → halib-0.2.10}/halib/filetype/ipynb.py +0 -0
  39. {halib-0.2.9 → halib-0.2.10}/halib/filetype/jsonfile.py +0 -0
  40. {halib-0.2.9 → halib-0.2.10}/halib/filetype/textfile.py +0 -0
  41. {halib-0.2.9 → halib-0.2.10}/halib/filetype/videofile.py +0 -0
  42. {halib-0.2.9 → halib-0.2.10}/halib/filetype/yamlfile.py +0 -0
  43. {halib-0.2.9 → halib-0.2.10}/halib/online/__init__.py +0 -0
  44. {halib-0.2.9 → halib-0.2.10}/halib/online/gdrive.py +0 -0
  45. {halib-0.2.9 → halib-0.2.10}/halib/online/gdrive_mkdir.py +0 -0
  46. {halib-0.2.9 → halib-0.2.10}/halib/online/projectmake.py +0 -0
  47. {halib-0.2.9 → halib-0.2.10}/halib/online/tele_noti.py +0 -0
  48. {halib-0.2.9 → halib-0.2.10}/halib/system/__init__.py +0 -0
  49. {halib-0.2.9 → halib-0.2.10}/halib/system/cmd.py +0 -0
  50. {halib-0.2.9 → halib-0.2.10}/halib/system/filesys.py +0 -0
  51. {halib-0.2.9 → halib-0.2.10}/halib/utils/__init__.py +0 -0
  52. {halib-0.2.9 → halib-0.2.10}/halib/utils/dict.py +0 -0
  53. {halib-0.2.9 → halib-0.2.10}/halib/utils/list.py +0 -0
  54. {halib-0.2.9 → halib-0.2.10}/halib.egg-info/dependency_links.txt +0 -0
  55. {halib-0.2.9 → halib-0.2.10}/halib.egg-info/requires.txt +0 -0
  56. {halib-0.2.9 → halib-0.2.10}/halib.egg-info/top_level.txt +0 -0
  57. {halib-0.2.9 → halib-0.2.10}/setup.cfg +0 -0
@@ -0,0 +1,5 @@
1
+ prune _archived
2
+ prune test
3
+ prune zout
4
+ exclude *.toml
5
+ include halib/system/_list_pc.csv
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: halib
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: Small library for common tasks
5
5
  Author: Hoang Van Ha
6
6
  Author-email: hoangvanhauit@gmail.com
@@ -53,7 +53,7 @@ Dynamic: summary
53
53
 
54
54
  # Helper package for coding and automation
55
55
 
56
- **Version 0.2.9**
56
+ **Version 0.2.10**
57
57
  + reorganize packages with most changes in `research` package; also rename `research` to `exp` (package for experiment management and utilities)
58
58
  + update `exp/perfcalc.py` to allow save computed performance to csv file (without explicit calling method `calc_perfs`)
59
59
 
@@ -1,6 +1,6 @@
1
1
  # Helper package for coding and automation
2
2
 
3
- **Version 0.2.9**
3
+ **Version 0.2.10**
4
4
  + reorganize packages with most changes in `research` package; also rename `research` to `exp` (package for experiment management and utilities)
5
5
  + update `exp/perfcalc.py` to allow save computed performance to csv file (without explicit calling method `calc_perfs`)
6
6
 
@@ -0,0 +1,6 @@
1
+ pc_name;abbr;working_disk
2
+ DESKTOP-JQD9K01;MainPC;E:
3
+ DESKTOP-5IRHU87;MSI_Laptop;D:
4
+ DESKTOP-96HQCNO;4090_SV;E:
5
+ DESKTOP-Q2IKLC0;4GPU_SV;D:
6
+ DESKTOP-QNS3DNF;1GPU_SV;D:
@@ -3,28 +3,39 @@ from ..filetype import csvfile
3
3
  import pandas as pd
4
4
  import platform
5
5
  import re # <--- [FIX 1] Added missing import
6
-
7
- PC_TO_ABBR = {
8
- "DESKTOP-JQD9K01": "MainPC",
9
- "DESKTOP-5IRHU87": "MSI_Laptop",
10
- "DESKTOP-96HQCNO": "4090_SV",
11
- "DESKTOP-Q2IKLC0": "4GPU_SV",
12
- "DESKTOP-QNS3DNF": "1GPU_SV",
13
- }
14
-
15
- ABBR_DISK_MAP = {
16
- "MainPC": "E:",
17
- "MSI_Laptop": "D:",
18
- "4090_SV": "E:",
19
- "4GPU_SV": "D:",
20
- }
6
+ import csv
7
+ from importlib import resources
8
+
9
+ PC_TO_ABBR = {}
10
+ ABBR_DISK_MAP = {}
11
+ pc_df = None
12
+ cPlatform = platform.system().lower()
13
+
14
+
15
+ def load_pc_meta_info():
16
+ # 1. Define the package where the file lives (dotted notation)
17
+ # Since the file is in 'halib/system/', the package is 'halib.system'
18
+ package_name = "halib.system"
19
+ file_name = "_list_pc.csv"
20
+
21
+ # 2. Locate the file
22
+ csv_path = resources.files(package_name).joinpath(file_name)
23
+ global PC_TO_ABBR, ABBR_DISK_MAP, pc_df
24
+ pc_df = pd.read_csv(csv_path, sep=';', encoding='utf-8')
25
+ PC_TO_ABBR = dict(zip(pc_df['pc_name'], pc_df['abbr']))
26
+ ABBR_DISK_MAP = dict(zip(pc_df['abbr'], pc_df['working_disk']))
27
+ pprint("Loaded PC meta info:")
28
+ pprint(ABBR_DISK_MAP)
29
+ pprint(PC_TO_ABBR)
30
+ # ! must be called at the module load time
31
+ load_pc_meta_info()
21
32
 
22
33
 
23
34
  def list_PCs(show=True):
24
- df = pd.DataFrame(list(PC_TO_ABBR.items()), columns=["PC Name", "Abbreviation"])
35
+ global pc_df
25
36
  if show:
26
- csvfile.fn_display_df(df)
27
- return df
37
+ csvfile.fn_display_df(pc_df)
38
+ return pc_df
28
39
 
29
40
 
30
41
  def get_PC_name():
@@ -44,11 +55,12 @@ def get_working_disk(abbr_disk_map=ABBR_DISK_MAP):
44
55
  pc_abbr = get_PC_abbr_name()
45
56
  return abbr_disk_map.get(pc_abbr, None)
46
57
 
58
+ cDisk = get_working_disk()
47
59
 
48
60
  # ! This funcction search for full paths in the obj and normalize them according to the current platform and working disk
49
61
  # ! E.g: "E:/zdataset/DFire", but working_disk: "D:", current_platform: "windows" => "D:/zdataset/DFire"
50
62
  # ! E.g: "E:/zdataset/DFire", but working_disk: "D:", current_platform: "linux" => "/mnt/d/zdataset/DFire"
51
- def normalize_paths(obj, working_disk=None, current_platform=None):
63
+ def normalize_paths(obj, working_disk=cDisk, current_platform=cPlatform):
52
64
  # [FIX 3] Resolve defaults inside function to be safer/cleaner
53
65
  if working_disk is None:
54
66
  working_disk = get_working_disk()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: halib
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: Small library for common tasks
5
5
  Author: Hoang Van Ha
6
6
  Author-email: hoangvanhauit@gmail.com
@@ -53,7 +53,7 @@ Dynamic: summary
53
53
 
54
54
  # Helper package for coding and automation
55
55
 
56
- **Version 0.2.9**
56
+ **Version 0.2.10**
57
57
  + reorganize packages with most changes in `research` package; also rename `research` to `exp` (package for experiment management and utilities)
58
58
  + update `exp/perfcalc.py` to allow save computed performance to csv file (without explicit calling method `calc_perfs`)
59
59
 
@@ -45,6 +45,7 @@ halib/online/gdrive_mkdir.py
45
45
  halib/online/projectmake.py
46
46
  halib/online/tele_noti.py
47
47
  halib/system/__init__.py
48
+ halib/system/_list_pc.csv
48
49
  halib/system/cmd.py
49
50
  halib/system/filesys.py
50
51
  halib/system/path.py
@@ -8,13 +8,14 @@ with open("requirements.txt") as f:
8
8
 
9
9
  setuptools.setup(
10
10
  name="halib",
11
- version="0.2.9",
11
+ version="0.2.10",
12
12
  author="Hoang Van Ha",
13
13
  author_email="hoangvanhauit@gmail.com",
14
14
  description="Small library for common tasks",
15
15
  long_description=long_description,
16
16
  long_description_content_type="text/markdown",
17
17
  packages=setuptools.find_packages(),
18
+ include_package_data=True, # This reads your MANIFEST.in
18
19
  classifiers=[
19
20
  "Programming Language :: Python :: 3",
20
21
  "License :: OSI Approved :: MIT License",
halib-0.2.9/MANIFEST.in DELETED
@@ -1,4 +0,0 @@
1
- prune _archived
2
- prune test
3
- prune zout
4
- exclude *.toml
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