Module ImportFrom alias alias alias Import alias identifier ImportFrom alias alias alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body Pass TryExcept body Import alias identifier handlers ExceptHandler type NameLoad body Pass ClassDef bases NameLoad body Assign NameStore Str FunctionDef arguments args NameParam defaults body Expr Call NameLoad Assign NameStore ListLoad Num Num Num Num Num Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore BinOpMod Str Call NameLoad keyword NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore Call NameLoad NameLoad NameLoad If CompareLt NameLoad Num body Expr Call NameLoad BinOpMult Str Num Expr Call NameLoad Str Expr Call NameLoad BinOpMult Str Num orelse Expr Call NameLoad Str Return BinOpDiv Call NameLoad NameLoad Call NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Num Assign TupleStore NameStore NameStore TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Num NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Num Num NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore ListLoad Str Str Assign NameStore ListLoad ListLoad Num Num Num ListLoad Str Str Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr Lambda arguments args NameParam NameParam defaults BinOpMult BinOpMult BinOpMult NameLoad BinOpSub Num NameLoad Call AttributeLoad NameLoad attr BinOpMult BinOpMult Num AttributeLoad NameLoad attr NameLoad BinOpPow Call AttributeLoad NameLoad attr BinOpMult BinOpMult Num AttributeLoad NameLoad attr BinOpPow NameLoad Num Num Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Num Num NameLoad Slice Num Num NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Num Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore ListLoad Str Str Assign NameStore ListLoad ListLoad Num Num Num Num Num ListLoad Str Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpDiv UnaryOpUSub AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult Num NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore ListLoad Str Str Assign NameStore ListLoad ListLoad Num Num Num ListLoad Str Str Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore BinOpDiv NameLoad Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr UnaryOpUSub NameLoad NameLoad Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr UnaryOpUSub NameLoad NameLoad Num Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd BinOpPow AttributeLoad NameLoad attr Num BinOpPow AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore ListLoad Str Str Assign NameStore ListLoad ListLoad Num Num Num ListLoad Str Str Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpDiv NameLoad Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr UnaryOpUSub NameLoad NameLoad Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr UnaryOpUSub NameLoad NameLoad Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpSub UnaryOpUSub BinOpPow AttributeLoad NameLoad attr Num BinOpPow AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore ListLoad Str Str Assign NameStore ListLoad ListLoad Num Num Num ListLoad Num Num Num FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore BinOpDiv NameLoad Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr UnaryOpUSub NameLoad NameLoad Num Assign AttributeStore NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr UnaryOpUSub BinOpPow AttributeLoad NameLoad attr Num BinOpMult Num Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str Assign NameStore ListLoad ListLoad Num Num Num FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Num NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr Num NameLoad Num Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore BinOpSub Call AttributeLoad NameLoad attr Num Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr Num Assign NameStore BinOpSub Call AttributeLoad NameLoad attr Num Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr Num Assign NameStore Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad BinOpSub NameLoad NameLoad Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad BinOpSub NameLoad NameLoad Num Assign AttributeStore NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr NameLoad BinOpMult Num Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore ListLoad Str Str Assign NameStore ListLoad ListLoad Num Num Num ListLoad Str Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpDiv UnaryOpUSub AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Str orelse Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list
N/A __future__ division absolute_import print_function N/A numpy np common run_monitored set_mem_rlimit Benchmark N/A N/A scipy.stats spearmanr N/A N/A N/A ImportError N/A N/A N/A N/A N/A scipy.interpolate interpolate N/A N/A N/A ImportError N/A N/A Leaks N/A Benchmark N/A N/A unit relative increase with repeats track_leaks N/A N/A self N/A N/A N/A N/A set_mem_rlimit N/A repeats N/A 2 5 10 50 200 N/A peak_mems N/A N/A repeat repeats N/A N/A code N/A 
            import numpy as np
            from scipy.interpolate import griddata

            def func(x, y):
                return x*(1-x)*np.cos(4*np.pi*x) * np.sin(4*np.pi*y**2)**2

            grid_x, grid_y = np.mgrid[0:1:100j, 0:1:200j]
            points = np.random.rand(1000, 2)
            values = func(points[:,0], points[:,1])

            for t in range(%(repeat)d):
                for method in ['nearest', 'linear', 'cubic']:
                    griddata(points, values, (grid_x, grid_y), method=method)

             N/A dict repeat repeat N/A N/A _ peak_mem N/A run_monitored code N/A N/A N/A peak_mems append peak_mem N/A N/A corr p N/A spearmanr repeats peak_mems N/A N/A p 0.05 N/A N/A N/A print N/A * 79 N/A N/A print PROBABLE MEMORY LEAK N/A N/A print N/A * 79 N/A N/A N/A print PROBABLY NO MEMORY LEAK N/A N/A N/A max peak_mems N/A min peak_mems N/A N/A BenchPPoly N/A Benchmark N/A setup N/A N/A self N/A N/A N/A N/A N/A N/A np random seed 1234 N/A N/A m k N/A 55 3 N/A x N/A N/A np sort N/A N/A N/A np random random N/A m 1 N/A c N/A N/A N/A np random random N/A 3 m N/A N/A self pp N/A N/A interpolate PPoly c x N/A npts 100 N/A N/A self xp N/A N/A np linspace 0 1 npts N/A time_evaluation N/A N/A self N/A N/A N/A N/A N/A self pp N/A self xp N/A N/A GridData N/A Benchmark N/A N/A param_names N/A n_grids method N/A params N/A N/A 10j 100j 1000j N/A nearest linear cubic setup N/A N/A self n_grids method N/A N/A N/A N/A self func N/A N/A N/A x y N/A N/A N/A N/A x N/A 1 x N/A N/A np cos N/A N/A 4 N/A np pi x N/A N/A N/A np sin N/A N/A 4 N/A np pi N/A y 2 2 N/A N/A N/A self grid_x N/A self grid_y N/A N/A np mgrid N/A N/A 0 1 n_grids N/A 0 1 n_grids N/A N/A self points N/A N/A N/A np random rand 1000 2 N/A N/A self values N/A N/A self func N/A N/A self points N/A N/A N/A 0 N/A N/A self points N/A N/A N/A 1 N/A time_evaluation N/A N/A self n_grids method N/A N/A N/A N/A N/A interpolate griddata N/A self points N/A self values N/A N/A self grid_x N/A self grid_y method method N/A N/A Interpolate1d N/A Benchmark N/A N/A param_names N/A n_samples method N/A params N/A N/A 10 50 100 1000 10000 N/A linear nearest zero slinear quadratic cubic setup N/A N/A self n_samples method N/A N/A N/A N/A self x N/A N/A np arange n_samples N/A N/A self y N/A N/A np exp N/A N/A N/A self x 3.0 N/A N/A self interpolator N/A N/A interpolate interp1d N/A self x N/A self y kind method N/A N/A self xp N/A N/A np linspace N/A N/A self x N/A 0 N/A N/A self x N/A -1 N/A 4 n_samples N/A time_interpolate N/A N/A self n_samples method N/A N/A N/A Time the construction overhead. N/A N/A N/A interpolate interp1d N/A self x N/A self y kind method N/A time_interpolate_eval N/A N/A self n_samples method N/A N/A N/A Time the evaluation. N/A N/A N/A self interpolator N/A self xp N/A N/A Interpolate2d N/A Benchmark N/A N/A param_names N/A n_samples method N/A params N/A N/A 10 50 100 N/A linear cubic quintic setup N/A N/A self n_samples method N/A N/A N/A r_samples N/A n_samples 2.0 N/A N/A self x N/A N/A np arange N/A r_samples r_samples 0.25 N/A N/A self y N/A N/A np arange N/A r_samples r_samples 0.25 N/A N/A N/A self xx N/A self yy N/A N/A np meshgrid N/A self x N/A self y N/A N/A self z N/A N/A np sin N/A N/A N/A self xx 2 N/A N/A self yy 2 N/A time_interpolate N/A N/A self n_samples method N/A N/A N/A N/A N/A interpolate interp2d N/A self x N/A self y N/A self z kind method N/A N/A Rbf N/A Benchmark N/A N/A param_names N/A n_samples function N/A params N/A N/A 10 50 100 N/A multiquadric inverse gaussian linear cubic quintic thin_plate setup N/A N/A self n_samples function N/A N/A N/A N/A self x N/A N/A np arange n_samples N/A N/A self y N/A N/A np sin N/A self x N/A r_samples N/A n_samples 2.0 N/A N/A self X N/A N/A np arange N/A r_samples r_samples 0.25 N/A N/A self Y N/A N/A np arange N/A r_samples r_samples 0.25 N/A N/A self z N/A N/A np exp N/A N/A N/A N/A self X 2 N/A N/A self Y 2 N/A time_rbf_1d N/A N/A self n_samples function N/A N/A N/A N/A N/A interpolate Rbf N/A self x N/A self y function function N/A time_rbf_2d N/A N/A self n_samples function N/A N/A N/A N/A N/A interpolate Rbf N/A self X N/A self Y N/A self z function function N/A N/A UnivariateSpline N/A Benchmark N/A N/A param_names N/A n_samples degree N/A params N/A N/A 10 50 100 N/A 3 4 5 setup N/A N/A self n_samples degree N/A N/A N/A r_samples N/A n_samples 2.0 N/A N/A self x N/A N/A np arange N/A r_samples r_samples 0.25 N/A N/A self y N/A N/A N/A np exp N/A N/A N/A self x 2 N/A 0.1 N/A N/A N/A np random randn N/A N/A self x shape N/A time_univariate_spline N/A N/A self n_samples degree N/A N/A N/A N/A N/A interpolate UnivariateSpline N/A self x N/A self y k degree N/A N/A BivariateSpline N/A Benchmark N/A N/A 
    Author: josef-pktd and scipy mailinglist example
    'http://scipy-user.10969.n7.nabble.com/BivariateSpline-examples    -and-my-crashing-python-td14801.html'
     N/A param_names N/A n_samples N/A params N/A N/A 10 20 30 setup N/A N/A self n_samples N/A N/A N/A x N/A N/A np arange 0 n_samples 0.5 N/A y N/A N/A np arange 0 n_samples 0.5 N/A N/A x y N/A N/A np meshgrid x y N/A x N/A N/A x ravel N/A y N/A N/A y ravel N/A xmin N/A N/A N/A x min 1 N/A xmax N/A N/A N/A x max 1 N/A ymin N/A N/A N/A y min 1 N/A ymax N/A N/A N/A y max 1 N/A s 1.1 N/A N/A self yknots N/A N/A np linspace N/A ymin s N/A ymax s 10 N/A N/A self xknots N/A N/A np linspace N/A xmin s N/A xmax s 10 N/A N/A self z N/A N/A N/A np sin x N/A 0.1 N/A N/A N/A np random normal size N/A x shape N/A N/A self x x N/A N/A self y y N/A time_smooth_bivariate_spline N/A N/A self n_samples N/A N/A N/A N/A N/A interpolate SmoothBivariateSpline N/A self x N/A self y N/A self z N/A time_lsq_bivariate_spline N/A N/A self n_samples N/A N/A N/A N/A N/A interpolate LSQBivariateSpline N/A self x N/A self y N/A self z N/A N/A self xknots flat N/A N/A self yknots flat N/A N/A Interpolate N/A Benchmark N/A N/A 
    Linear Interpolate in scipy and numpy
     N/A param_names N/A n_samples module N/A params N/A N/A 10 50 100 N/A numpy scipy setup N/A N/A self n_samples module N/A N/A N/A N/A self x N/A N/A np arange n_samples N/A N/A self y N/A N/A np exp N/A N/A N/A self x 3.0 N/A N/A self z N/A N/A N/A np random normal size N/A N/A self x shape N/A time_interpolate N/A N/A self n_samples module N/A N/A N/A N/A module scipy N/A N/A N/A N/A interpolate interp1d N/A self x N/A self y kind linear N/A N/A N/A N/A np interp N/A self z N/A self x N/A self y N/A N/A