Skip to content

Commit

Permalink
shorten debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfgangFahl committed Mar 10, 2024
1 parent 0723c87 commit c1e016b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/test_loctime.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def test_loctime_parsing(self):
"""
Test function to analyze loctime and count occurrences of parts.
"""
debug=self.debug
ltp = self.loctime_parser
for v in self.volumes:
loctime = v["loctime"]
Expand All @@ -56,16 +57,19 @@ def test_loctime_parsing(self):
for part, count in counter.most_common(100):
percentage_table.add_value(row_title=f"{key}: {part}", value=count)

print(percentage_table.generate_table())
if debug:
print(percentage_table.generate_table())

for reverse_pos in range(1, 8):
counter = ltp.counters[str(reverse_pos)]
print(f"== {reverse_pos} ({len(counter)}) ==")
if debug:
print(f"== {reverse_pos} ({len(counter)}) ==")
# Sorting the counter items by count in descending order
for part, count in sorted(
counter.items(), key=lambda item: item[1], reverse=True
):
print(f" {part}: {count}")
if debug:
print(f" {part}: {count}")

pareto_dict = ltp.create_pareto_analysis(level=2)
if self.debug:
Expand All @@ -82,4 +86,5 @@ def test_loctime_parsing(self):

for threshold, count in pareto_range.items():
percentage_table.add_value(f"{threshold:.1f}%", count)
print(percentage_table.generate_table())
if debug:
print(percentage_table.generate_table())

0 comments on commit c1e016b

Please sign in to comment.