pyrocko.avl

Efficient ordered sequence container based on AVL trees.

Functions

dump

avl.dump(t,pickler) - convenience function warning: pickler is not type-checked

from_iter

t=avl.from_iter(iter[,len[,compare=None]]) Items in sequence must be sorted w.r.t.

load

t=avl.load(unpickler) - convenience function warning: no type-check

new

Factory usage.

dump()

avl.dump(t,pickler) - convenience function warning: pickler is not type-checked

from_iter()

t=avl.from_iter(iter[,len[,compare=None]]) Items in sequence must be sorted w.r.t. function ‘compare’, which is not used in the process warning: no type-check

load()

t=avl.load(unpickler) - convenience function warning: no type-check

new()

Factory usage:

t = avl.new(arg, compare=None, unique=0)
  • With no argument, returns a new and empty tree;

  • Given a list, it will return a new tree containing the elements of the list, and will sort the list as a side-effect

  • Given a tree, it will return a copy of the original tree (ignoring any other argument)

Parameters:
  • compare (callable or None) – Python key-comparison function

  • unique (bool) – ignore duplicates