Table of Contents

Module: operations src/operations.py

Simple operations (filtering, and so on) on groups of objects. You must call cut or fix on the results of these before trying any annotations.

Functions   
byframe
bysize
bytype
cut
diff
filterd
filterouttype
filtersize
filtertype
fix
pos
sorted
top
toplist
  byframe 
byframe ( wrappers )

Collect objects according to the file name and line number of code where they were created.

Can be printed using formatting.printsizesop.

  bysize 
bysize ( wrappers )

Collect objects into sizes, returning a dictionary from size to (size, total size, sample object).

Can be printed using formatting.printsizesop.

  bytype 
bytype ( sizes )

Collect objects into types, returning a dictionary from type to (type, total size, sample object).

Can be printed using formatting.printsizesop.

  cut 
cut ( wrappers )

Takes a dictionary of wrappers, and removes all references to wrappers not in the dictionary from it. This will make the dictionary valid for functions in annotate.

You should call this on anything you get from operations before you call the functions from annotate on them.

This function changes the wrappers in-place.

  diff 
diff ( sizes1,  sizes2 )

Takes two dictionaries sizes1 and sizes2 of wrappers, and returns sizes2 \ sizes1 - i.e. the objects found in sizes2 but not sizes1.

  filterd 
filterd ( dict,  pred )

Filter a dictionary of wrappers. Returns a dictionary of wrappers containing the wrappers w such that pred(w) is true.

  filterouttype 
filterouttype ( dict,  atype )

Filter out a dictionary by type. Returns a dictionary giving all wrappers except those whose object's type is atype.

  filtersize 
filtersize ( dict,  asize )

Filter a dictionary of wrappers by size. Returns a dictionary giving only those wrappers whose object's size is asize.

  filtertype 
filtertype ( dict,  atype )

Filter a dictionary of wrappers by type. Returns a dictionary giving only those wrappers whose object's type is atype.

  fix 
fix ( wrappers )

Takes a dictionary of wrappers, and removes all references to wrappers not in the dictionary from it. This will make the dictionary valid for functions in annotate.

You should call this on anything you get from operations before you call the functions from annotate on them.

This function returns a new set of wrappers.

  pos 
pos ( n,  sizes )

Takes a dictionary of wrappers, and returns the nth biggest one. If there are less than n wrappers, returns the smallest.

  sorted 
sorted ( sizes )

Takes a dictionary of wrappers, and returns a sorted list of wrappers, with the largest first.

  top 
top ( n,  sizes )

Takes a dictionary of wrappers, and returns a dictionary containing only the biggest n.

  toplist 
toplist ( n,  sizes )

Takes a dictionary of wrappers, and returns a sorted list containing the biggest n in descending order (largest first).


Table of Contents

This document was automatically generated on Mon Apr 3 22:34:29 2006 by HappyDoc version 2.1