Skip to content

Implement condensed tree representation

What does this MR do?

This MR implements a condensed tree representation for BaseDataGroup, accessible via the tree_condensed property.

Screenshot_2020-01-15_at_20.53.59

There are two ways to control it:

  • max_level: entries beyond this level are not traversed
  • condense_thresh: the max. number of lines to show
    • Hidden lines are condensed via a ... (N more) ... string
    • Has to be 3 or larger.
    • This can also be a Callable, allowing to dynamically set this value depending on the following variables:
      • level
      • num_items that would be emitted
      • total_item_count along one branch of the recursion.

The default values for these are read from _COND_TREE_MAX_LEVEL and _COND_TREE_CONDENSE_THRESH class attributes, allowing for easy customisation.
Furthermore, these values can be set for each DataManager instance by passing the condensed_tree_params dict to DataManager.__init__.

Can this MR be accepted?

  • Implemented the feature
  • Tests added or adjusted (coverage test only)
  • Pipeline passes
  • Changelog entry added
  • Approved by @jeremiastraub

Anything to double-check?

Tree representation working as expected? Tests cannot really assert this, I had to test this visually...

Related issues

Closes #112 (closed), #30 (closed)

Edited by Utopia Developers

Merge request reports