Code Search for Developers
 
 
  

inside_poly_memleak.py from matplotlib at Krugle


Show inside_poly_memleak.py syntax highlighted

#!/usr/bin/env python

import os, sys, time
import matplotlib.nxutils as nxutils
import matplotlib.numerix as nx

def report_memory(i):
    pid = os.getpid()
    a2 = os.popen('ps -p %d -o rss,sz' % pid).readlines()
    print i, '  ', a2[1],
    return int(a2[1].split()[1])



for i in range(500):
    report_memory(i)
    verts = nx.mlab.rand(100, 2)
    b = nxutils.pnpoly(x, y, verts)

    for i in range(500):
        report_memory(i)
        verts = nx.mlab.rand(100, 2)
        points = nx.mlab.rand(10000,2)
        mask = nxutils.points_inside_poly(points, verts)





See more files for this project here

matplotlib

Matplotlib is a pure python plotting library with the goal of making\r\npublication quality plots using a syntax familiar to matlab users. \r\nThe library uses Numeric for handling large\r\ndata sets and supports a variety of output backends

Project homepage: http://sourceforge.net/projects/matplotlib
Programming language(s): C,C++,Python
License: other

  pathologies/
    const_xy.py
    shapes.py
    single_date.py
    single_point.py
    test.py
  __init__.py
  agg_memleak.py
  auto_legend.py
  dates_unit.py
  ft2font_memleak.py
  helpers.py
  inside_poly_memleak.py
  inside_poly_profile.py
  legend_unit.py
  longs_test.py
  memleak_gui.py
  memleak_hawaii3.py
  memleak_nongui.py
  memleak_transforms.py
  override_builtins.py
  simple_plot.py
  test_wxagg.py
  transform_memleak.py
  transforms_unit.py