Skip to content

Commit

Permalink
Respect stripzeros in summary report
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Mar 27, 2024
1 parent 171658c commit 7a1fbb7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 8 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
Changes
=======

4.1.3
~~~~~
* FIX: duration summary now respects the stripzeros argument.

4.1.2
~~~~
~~~~~
* ENH: Add support for Python 3.12 #246
* ENH: Add osx universal2 and arm64 wheels #251
* ENH: Fix issue with integer overflow on 32 bit systems #249

4.1.1
~~~~
~~~~~
* FIX: ``get_stats`` is no longer slowed down when profiling many code sections #236

4.1.0
~~~~
~~~~~
* FIX: skipzeros now checks for zero hits instead of zero time
* FIX: Fixed errors in Python 3.11 with duplicate functions.
* FIX: ``show_text`` now increases column sizes or switches to scientific notation to maintain alignment
Expand All @@ -24,7 +28,7 @@ Changes
* ENH: Added readthedocs integration: https://kernprof.readthedocs.io/en/latest/index.html

4.0.3
~~~~
~~~~~
* FIX: Stop requiring bleeding-edge Cython unless necesasry (for Python 3.12). #206

4.0.2
Expand Down
5 changes: 3 additions & 2 deletions line_profiler/line_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,9 @@ def show_text(stats, unit, output_unit=None, stream=None, stripzeros=False,
# Summarize the total time for each function
for (fn, lineno, name), timings in stats_order:
total_time = sum(t[2] for t in timings) * unit
line = '%6.2f seconds - %s:%s - %s\n' % (total_time, fn, lineno, name)
stream.write(line)
if not stripzeros or total_time:
line = '%6.2f seconds - %s:%s - %s\n' % (total_time, fn, lineno, name)
stream.write(line)


def load_stats(filename):
Expand Down

0 comments on commit 7a1fbb7

Please sign in to comment.