kenenet 0.9.3__py3-none-any.whl → 0.9.5__py3-none-any.whl
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.
- kenenet/__init__.py +14 -15
- {kenenet-0.9.3.dist-info → kenenet-0.9.5.dist-info}/METADATA +1 -1
- kenenet-0.9.5.dist-info/RECORD +5 -0
- kenenet-0.9.3.dist-info/RECORD +0 -5
- {kenenet-0.9.3.dist-info → kenenet-0.9.5.dist-info}/WHEEL +0 -0
- {kenenet-0.9.3.dist-info → kenenet-0.9.5.dist-info}/top_level.txt +0 -0
kenenet/__init__.py
CHANGED
@@ -356,7 +356,6 @@ def time_code(details=True, chunks=True, label=None):
|
|
356
356
|
sys.settrace(trace_function)
|
357
357
|
|
358
358
|
else:
|
359
|
-
|
360
359
|
sys.settrace(None)
|
361
360
|
context = _current_context
|
362
361
|
_current_context = None
|
@@ -373,29 +372,29 @@ def time_code(details=True, chunks=True, label=None):
|
|
373
372
|
quick_print(f"{'Line':>6} | {'Time':>12} | Code")
|
374
373
|
quick_print("-" * 80)
|
375
374
|
|
376
|
-
|
377
|
-
|
378
|
-
|
375
|
+
for lineno, line_content, elapsed in sorted_timings:
|
376
|
+
if line_content not in _ignore_line:
|
377
|
+
quick_print(f"{lineno:6d} | {elapsed:12.6f} | {line_content}")
|
379
378
|
|
380
|
-
|
379
|
+
quick_print("-" * 80)
|
381
380
|
total_time = sum(elapsed for _, _, elapsed in _timings[context])
|
382
381
|
if details: quick_print(f"Total execution time: {total_time:.6f}")
|
383
|
-
|
384
|
-
if _block_timings
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
382
|
+
|
383
|
+
if _block_timings:
|
384
|
+
if chunks:
|
385
|
+
quick_print("\nTime spent on chunks of code:")
|
386
|
+
quick_print("-" * 80)
|
387
|
+
quick_print(f"{'Chunks':^40} | {'Time':>12} | {'% of Time Spent':>10}")
|
388
|
+
quick_print("-" * 80)
|
389
389
|
|
390
390
|
# Sort block timings by time
|
391
391
|
sorted_blocks = sorted(_block_timings.items(), key=lambda x: x[1], reverse=True)
|
392
|
-
|
393
|
-
|
394
|
-
if block not in _ignore_line:
|
392
|
+
if chunks:
|
393
|
+
for block, elapsed in sorted_blocks:
|
395
394
|
percentage = (elapsed / total_time) * 100 if total_time > 0 else 0
|
396
395
|
quick_print(f"{block[:40]:40} | {elapsed:12.6f} | {percentage:10.2f}%")
|
397
396
|
|
398
|
-
quick_print("-" * 80)
|
397
|
+
if chunks: quick_print("-" * 80)
|
399
398
|
|
400
399
|
# Clear the timing data for this context
|
401
400
|
del _timings[context]
|
@@ -0,0 +1,5 @@
|
|
1
|
+
kenenet/__init__.py,sha256=GBgXUBDyYUIZOEc6S-N7AymUAA1YZBUvkRRuG8paV78,16520
|
2
|
+
kenenet-0.9.5.dist-info/METADATA,sha256=eV_WXprch9sJIqtwJNYOoXWUefVZldqV-4nc6A86Hck,633
|
3
|
+
kenenet-0.9.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
+
kenenet-0.9.5.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
+
kenenet-0.9.5.dist-info/RECORD,,
|
kenenet-0.9.3.dist-info/RECORD
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
kenenet/__init__.py,sha256=aleghOWGKnH-vyEonTNmHXG0NA0JYkUJdgf8z0tm4BI,16527
|
2
|
-
kenenet-0.9.3.dist-info/METADATA,sha256=Sp1a2ePyDFKGk7UaPj7RNK8uem7SCATQgI7eRVw-FXI,633
|
3
|
-
kenenet-0.9.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
-
kenenet-0.9.3.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
-
kenenet-0.9.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|