Skip to content

Adds print elision logic for similar consecutive nodes.#163

Open
ghyatzo wants to merge 3 commits intoJuliaCollections:masterfrom
ghyatzo:patch/elide-print-similar-childnodes
Open

Adds print elision logic for similar consecutive nodes.#163
ghyatzo wants to merge 3 commits intoJuliaCollections:masterfrom
ghyatzo:patch/elide-print-similar-childnodes

Conversation

@ghyatzo
Copy link
Copy Markdown

@ghyatzo ghyatzo commented Mar 14, 2026

Hello, this PR aims at adding the ability to elide printing siblings that are similar.

at the moment it introduces the following behaviour:

  • after maxsiblings occurrences of similar node values start eliding

  • if a different enough node value appears reset the counter and start printing again

  • elided siblings are not recursed into.

  • users can define a nodevalue_distance function similar to how they can override printnode to define what "similar" means. it defaults to equality. Users can also pass in a threshold to finetune when things are going to be elided.

fixes: #144

initial prototype built with a robot friend, finetuned by hand.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.30%. Comparing base (5ed4c69) to head (f06f3f2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #163      +/-   ##
==========================================
+ Coverage   70.69%   72.30%   +1.61%     
==========================================
  Files           8        8              
  Lines         430      455      +25     
==========================================
+ Hits          304      329      +25     
  Misses        126      126              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ghyatzo ghyatzo force-pushed the patch/elide-print-similar-childnodes branch from b7c76c8 to 69f3a68 Compare March 14, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

printing broad trees should truncate

1 participant