MCPcopy Create free account
hub / github.com/chaimleib/intervaltree / print_structure

Method print_structure

intervaltree/node.py:589–610  ·  view source on GitHub ↗

For debugging.

(self, indent=0, tostring=False)

Source from the content-addressed store, hash-verified

587 return count
588
589 def print_structure(self, indent=0, tostring=False):
590 """
591 For debugging.
592 """
593 nl = '\n'
594 sp = indent * ' '
595
596 rlist = [str(self) + nl]
597 if self.s_center:
598 for iv in sorted(self.s_center):
599 rlist.append(sp + ' ' + repr(iv) + nl)
600 if self.left_node:
601 rlist.append(sp + '<: ') # no CR
602 rlist.append(self.left_node.print_structure(indent + 1, True))
603 if self.right_node:
604 rlist.append(sp + '>: ') # no CR
605 rlist.append(self.right_node.print_structure(indent + 1, True))
606 result = ''.join(rlist)
607 if tostring:
608 return result
609 else:
610 print(result)

Callers 10

treeFunction · 0.95
treeFunction · 0.95
verifyMethod · 0.95
test_deleteFunction · 0.45
tabulateMethod · 0.45
test_ivs1Function · 0.45
issue25_orig.pyFile · 0.45
issue41_orig.pyFile · 0.45

Calls

no outgoing calls

Tested by 4

test_deleteFunction · 0.36
tabulateMethod · 0.36
test_ivs1Function · 0.36