Skip to content

Remove Tree Checks

Note

Available from version 0.16.2 onwards

When constructing trees, there are a few checks done in BaseNode and DAGNode class that slow down performance. This slowness will be more apparent with very large trees. The checks are to

  • Check parent/children data type
  • Check for loops (expensive for trees that are deep as it checks the ancestors of node)

Note

Available from version 1.0.1 onwards

The further checks are removed from Node class.

  • Check for empty node name
  • Check for duplicated paths (expensive for trees that are wide as it checks the siblings of node)

These checks are enabled by default. To turn off these checks, you can set environment variable before importing bigtree.

import os
os.environ["BIGTREE_CONF_ASSERTIONS"] = ""

import bigtree

Alternatively, if you have already imported bigtree, you can set the configuration manually.

import bigtree

bigtree.Globals.ASSERTIONS = False