halib 0.2.30__tar.gz → 0.2.32__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.30 → halib-0.2.32}/PKG-INFO +2 -2
  2. {halib-0.2.30 → halib-0.2.32}/README.md +1 -1
  3. {halib-0.2.30 → halib-0.2.32}/halib/common/common.py +30 -13
  4. {halib-0.2.30 → halib-0.2.32}/halib.egg-info/PKG-INFO +2 -2
  5. {halib-0.2.30 → halib-0.2.32}/setup.py +1 -1
  6. {halib-0.2.30 → halib-0.2.32}/.gitignore +0 -0
  7. {halib-0.2.30 → halib-0.2.32}/GDriveFolder.txt +0 -0
  8. {halib-0.2.30 → halib-0.2.32}/LICENSE.txt +0 -0
  9. {halib-0.2.30 → halib-0.2.32}/MANIFEST.in +0 -0
  10. {halib-0.2.30 → halib-0.2.32}/halib/__init__.py +0 -0
  11. {halib-0.2.30 → halib-0.2.32}/halib/common/__init__.py +0 -0
  12. {halib-0.2.30 → halib-0.2.32}/halib/common/rich_color.py +0 -0
  13. {halib-0.2.30 → halib-0.2.32}/halib/exp/__init__.py +0 -0
  14. {halib-0.2.30 → halib-0.2.32}/halib/exp/core/__init__.py +0 -0
  15. {halib-0.2.30 → halib-0.2.32}/halib/exp/core/base_config.py +0 -0
  16. {halib-0.2.30 → halib-0.2.32}/halib/exp/core/base_exp.py +0 -0
  17. {halib-0.2.30 → halib-0.2.32}/halib/exp/core/param_gen.py +0 -0
  18. {halib-0.2.30 → halib-0.2.32}/halib/exp/core/wandb_op.py +0 -0
  19. {halib-0.2.30 → halib-0.2.32}/halib/exp/data/__init__.py +0 -0
  20. {halib-0.2.30 → halib-0.2.32}/halib/exp/data/dataclass_util.py +0 -0
  21. {halib-0.2.30 → halib-0.2.32}/halib/exp/data/dataset.py +0 -0
  22. {halib-0.2.30 → halib-0.2.32}/halib/exp/data/torchloader.py +0 -0
  23. {halib-0.2.30 → halib-0.2.32}/halib/exp/perf/__init__.py +0 -0
  24. {halib-0.2.30 → halib-0.2.32}/halib/exp/perf/flop_calc.py +0 -0
  25. {halib-0.2.30 → halib-0.2.32}/halib/exp/perf/gpu_mon.py +0 -0
  26. {halib-0.2.30 → halib-0.2.32}/halib/exp/perf/perfcalc.py +0 -0
  27. {halib-0.2.30 → halib-0.2.32}/halib/exp/perf/perfmetrics.py +0 -0
  28. {halib-0.2.30 → halib-0.2.32}/halib/exp/perf/perftb.py +0 -0
  29. {halib-0.2.30 → halib-0.2.32}/halib/exp/perf/profiler.py +0 -0
  30. {halib-0.2.30 → halib-0.2.32}/halib/exp/viz/__init__.py +0 -0
  31. {halib-0.2.30 → halib-0.2.32}/halib/exp/viz/plot.py +0 -0
  32. {halib-0.2.30 → halib-0.2.32}/halib/filetype/__init__.py +0 -0
  33. {halib-0.2.30 → halib-0.2.32}/halib/filetype/csvfile.py +0 -0
  34. {halib-0.2.30 → halib-0.2.32}/halib/filetype/ipynb.py +0 -0
  35. {halib-0.2.30 → halib-0.2.32}/halib/filetype/jsonfile.py +0 -0
  36. {halib-0.2.30 → halib-0.2.32}/halib/filetype/textfile.py +0 -0
  37. {halib-0.2.30 → halib-0.2.32}/halib/filetype/videofile.py +0 -0
  38. {halib-0.2.30 → halib-0.2.32}/halib/filetype/yamlfile.py +0 -0
  39. {halib-0.2.30 → halib-0.2.32}/halib/online/__init__.py +0 -0
  40. {halib-0.2.30 → halib-0.2.32}/halib/online/gdrive.py +0 -0
  41. {halib-0.2.30 → halib-0.2.32}/halib/online/gdrive_mkdir.py +0 -0
  42. {halib-0.2.30 → halib-0.2.32}/halib/online/projectmake.py +0 -0
  43. {halib-0.2.30 → halib-0.2.32}/halib/online/tele_noti.py +0 -0
  44. {halib-0.2.30 → halib-0.2.32}/halib/system/__init__.py +0 -0
  45. {halib-0.2.30 → halib-0.2.32}/halib/system/_list_pc.csv +0 -0
  46. {halib-0.2.30 → halib-0.2.32}/halib/system/cmd.py +0 -0
  47. {halib-0.2.30 → halib-0.2.32}/halib/system/filesys.py +0 -0
  48. {halib-0.2.30 → halib-0.2.32}/halib/system/path.py +0 -0
  49. {halib-0.2.30 → halib-0.2.32}/halib/utils/__init__.py +0 -0
  50. {halib-0.2.30 → halib-0.2.32}/halib/utils/dict.py +0 -0
  51. {halib-0.2.30 → halib-0.2.32}/halib/utils/list.py +0 -0
  52. {halib-0.2.30 → halib-0.2.32}/halib/utils/slack.py +0 -0
  53. {halib-0.2.30 → halib-0.2.32}/halib.egg-info/SOURCES.txt +0 -0
  54. {halib-0.2.30 → halib-0.2.32}/halib.egg-info/dependency_links.txt +0 -0
  55. {halib-0.2.30 → halib-0.2.32}/halib.egg-info/requires.txt +0 -0
  56. {halib-0.2.30 → halib-0.2.32}/halib.egg-info/top_level.txt +0 -0
  57. {halib-0.2.30 → halib-0.2.32}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: halib
3
- Version: 0.2.30
3
+ Version: 0.2.32
4
4
  Summary: Small library for common tasks
5
5
  Author: Hoang Van Ha
6
6
  Author-email: hoangvanhauit@gmail.com
@@ -57,7 +57,7 @@ Dynamic: summary
57
57
 
58
58
  ## v0.2.x (Experiment & Core Updates)
59
59
 
60
- ### **v0.2.30**
60
+ ### **v0.2.32**
61
61
 
62
62
  - ✨ **New Feature:**: add `common.common.log_func` as decorator to log function entry, exit, with execution time and arguments.
63
63
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## v0.2.x (Experiment & Core Updates)
4
4
 
5
- ### **v0.2.30**
5
+ ### **v0.2.32**
6
6
 
7
7
  - ✨ **New Feature:**: add `common.common.log_func` as decorator to log function entry, exit, with execution time and arguments.
8
8
 
@@ -1,3 +1,4 @@
1
+ from fiftyone.brain.internal.core.lancedb import pa
1
2
  import os
2
3
  import sys
3
4
  import re
@@ -261,39 +262,55 @@ def pprint_local_path(
261
262
 
262
263
 
263
264
  def log_func(
264
- func: Optional[Callable] = None, *, log_time: bool = False, log_args: bool = False
265
+ func: Optional[Callable] = None,
266
+ *,
267
+ log_time: bool = False,
268
+ log_args: bool = False,
269
+ skip_idxs: Optional[List[int]] = None, # New parameter
265
270
  ):
266
271
  """
267
- A decorator that logs the start/end of a function.
268
- Supports both @log_func and @log_func(log_time=True) usage.
272
+ Enhanced decorator that logs arguments line-by-line and allows skipping indices.
269
273
  """
270
- # 1. HANDLE ARGUMENTS: If called as @log_func(log_time=True), func is None.
271
- # We return a 'partial' function that remembers the args and waits for the func.
272
274
  if func is None:
273
- return functools.partial(log_func, log_time=log_time, log_args=log_args)
275
+ return functools.partial(
276
+ log_func, log_time=log_time, log_args=log_args, skip_idxs=skip_idxs
277
+ )
274
278
 
275
- # 2. HANDLE DECORATION: If called as @log_func, func is the actual function.
276
279
  @functools.wraps(func)
277
280
  def wrapper(*args, **kwargs):
278
- # Safe way to get name (handles partials/lambdas)
279
281
  func_name = getattr(func, "__name__", "Unknown_Func")
282
+ skip_list = skip_idxs or []
283
+
284
+ SUMMARY_WIDTH = 80
285
+ SUB_SUMMARY_WIDTH = 50
280
286
 
281
- # Note: Ensure 'ConsoleLog' context manager is available in your scope
282
287
  with ConsoleLog(func_name):
283
288
  start = time.perf_counter()
284
289
  try:
285
290
  result = func(*args, **kwargs)
286
291
  finally:
287
- # We use finally to ensure logging happens even if func crashes
288
292
  end = time.perf_counter()
289
293
 
290
294
  if log_time or log_args:
295
+ console.print(
296
+ pad_string(f"Func <{func_name}> summary", SUMMARY_WIDTH)
297
+ )
298
+
299
+ if log_args:
300
+ console.print(pad_string(f"Args Summary", SUMMARY_WIDTH))
301
+ # Log Positional Args line-by-line
302
+ for i, val in enumerate(args):
303
+ val = "SKIPPED" if i in skip_list else val
304
+ console.print(pad_string(f"arg[{i}]", SUB_SUMMARY_WIDTH))
305
+ pprint(val)
306
+ # Log Keyword Args line-by-line
307
+ for k, v in kwargs.items():
308
+ console.print(pad_string(f"{k}", SUB_SUMMARY_WIDTH))
309
+ pprint(v)
291
310
 
292
- console.print(pad_string(f"Func <{func_name}> summary", 80))
293
311
  if log_time:
312
+ console.print(pad_string(f"Time Summary", SUMMARY_WIDTH))
294
313
  console.print(f"{func_name} took {end - start:.6f} seconds")
295
- if log_args:
296
- console.print(f"Args: {args}, Kwargs: {kwargs}")
297
314
 
298
315
  return result
299
316
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: halib
3
- Version: 0.2.30
3
+ Version: 0.2.32
4
4
  Summary: Small library for common tasks
5
5
  Author: Hoang Van Ha
6
6
  Author-email: hoangvanhauit@gmail.com
@@ -57,7 +57,7 @@ Dynamic: summary
57
57
 
58
58
  ## v0.2.x (Experiment & Core Updates)
59
59
 
60
- ### **v0.2.30**
60
+ ### **v0.2.32**
61
61
 
62
62
  - ✨ **New Feature:**: add `common.common.log_func` as decorator to log function entry, exit, with execution time and arguments.
63
63
 
@@ -8,7 +8,7 @@ with open("requirements.txt", "r", encoding="utf-8") as f:
8
8
 
9
9
  setuptools.setup(
10
10
  name="halib",
11
- version="0.2.30",
11
+ version="0.2.32",
12
12
  author="Hoang Van Ha",
13
13
  author_email="hoangvanhauit@gmail.com",
14
14
  description="Small library for common tasks",
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