uv icon indicating copy to clipboard operation
uv copied to clipboard

Add debug representation for `MarkerTree`

Open ibraheemdev opened this issue 1 year ago • 2 comments

Summary

Adds a simple Debug representation for MarkerTree based on the underlying decision diagram. For example, python_version == '3.7' and os_name == 'Linux') or os_name == 'Windows' is displayed as:

python_version<3.7 | >3.7 -> 
  os_name<Windows | >Windows -> false
  os_name==Windows -> true
python_version==3.7 -> 
  os_name<Linux | >Linux, <Windows | >Windows -> false
  os_name==Linux | ==Windows -> true

I'm not sure we want to use this form for our debug logs because it could be confusing to users but we've also run into issues where markers looked equal when simplified despite being represented slightly differently..

ibraheemdev avatar Aug 15 '24 21:08 ibraheemdev

We should probably add a separate method display_maybe_empty for user facing output.

ibraheemdev avatar Aug 15 '24 21:08 ibraheemdev

but we've also run into issues where markers looked equal when simplified despite being represented slightly differently..

Can you show an example? I really like how our Debug implementation works today, especially since it fits on one line. (Although that does break down for larger markers.)

BurntSushi avatar Aug 16 '24 14:08 BurntSushi