Skip to content

Commit

Permalink
Merge branch 'master' into bug_issue16770
Browse files Browse the repository at this point in the history
  • Loading branch information
ri938 authored Jul 18, 2017
2 parents 9802288 + 34210ac commit 0e2d315
Show file tree
Hide file tree
Showing 123 changed files with 1,487 additions and 2,553 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` (On Windows, ``git diff upstream/master -u -- "*.py" | flake8 --diff`` might work as an alternative.)
- [ ] passes ``git diff upstream/master -u -- "*.py" | flake8 --diff``
- [ ] whatsnew entry
10 changes: 10 additions & 0 deletions .pep8speaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# File : .pep8speaks.yml

scanner:
diff_only: True # If True, errors caused by only the patch are shown

pycodestyle:
max-line-length: 79
ignore: # Errors and warnings to ignore
- E731
- E402
185 changes: 185 additions & 0 deletions asv_bench/benchmarks/rolling.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
from .pandas_vb_common import *
import pandas as pd
import numpy as np


class DataframeRolling(object):
goal_time = 0.2

def setup(self):
self.N = 100000
self.Ns = 10000
self.df = pd.DataFrame({'a': np.random.random(self.N)})
self.dfs = pd.DataFrame({'a': np.random.random(self.Ns)})
self.wins = 10
self.winl = 1000

def time_rolling_quantile_0(self):
(self.df.rolling(self.wins).quantile(0.0))

def time_rolling_quantile_1(self):
(self.df.rolling(self.wins).quantile(1.0))

def time_rolling_quantile_median(self):
(self.df.rolling(self.wins).quantile(0.5))

def time_rolling_median(self):
(self.df.rolling(self.wins).median())

def time_rolling_mean(self):
(self.df.rolling(self.wins).mean())

def time_rolling_max(self):
(self.df.rolling(self.wins).max())

def time_rolling_min(self):
(self.df.rolling(self.wins).min())

def time_rolling_std(self):
(self.df.rolling(self.wins).std())

def time_rolling_count(self):
(self.df.rolling(self.wins).count())

def time_rolling_skew(self):
(self.df.rolling(self.wins).skew())

def time_rolling_kurt(self):
(self.df.rolling(self.wins).kurt())

def time_rolling_sum(self):
(self.df.rolling(self.wins).sum())

def time_rolling_corr(self):
(self.dfs.rolling(self.wins).corr())

def time_rolling_cov(self):
(self.dfs.rolling(self.wins).cov())

def time_rolling_quantile_0_l(self):
(self.df.rolling(self.winl).quantile(0.0))

def time_rolling_quantile_1_l(self):
(self.df.rolling(self.winl).quantile(1.0))

def time_rolling_quantile_median_l(self):
(self.df.rolling(self.winl).quantile(0.5))

def time_rolling_median_l(self):
(self.df.rolling(self.winl).median())

def time_rolling_mean_l(self):
(self.df.rolling(self.winl).mean())

def time_rolling_max_l(self):
(self.df.rolling(self.winl).max())

def time_rolling_min_l(self):
(self.df.rolling(self.winl).min())

def time_rolling_std_l(self):
(self.df.rolling(self.wins).std())

def time_rolling_count_l(self):
(self.df.rolling(self.wins).count())

def time_rolling_skew_l(self):
(self.df.rolling(self.wins).skew())

def time_rolling_kurt_l(self):
(self.df.rolling(self.wins).kurt())

def time_rolling_sum_l(self):
(self.df.rolling(self.wins).sum())


class SeriesRolling(object):
goal_time = 0.2

def setup(self):
self.N = 100000
self.Ns = 10000
self.df = pd.DataFrame({'a': np.random.random(self.N)})
self.dfs = pd.DataFrame({'a': np.random.random(self.Ns)})
self.sr = self.df.a
self.srs = self.dfs.a
self.wins = 10
self.winl = 1000

def time_rolling_quantile_0(self):
(self.sr.rolling(self.wins).quantile(0.0))

def time_rolling_quantile_1(self):
(self.sr.rolling(self.wins).quantile(1.0))

def time_rolling_quantile_median(self):
(self.sr.rolling(self.wins).quantile(0.5))

def time_rolling_median(self):
(self.sr.rolling(self.wins).median())

def time_rolling_mean(self):
(self.sr.rolling(self.wins).mean())

def time_rolling_max(self):
(self.sr.rolling(self.wins).max())

def time_rolling_min(self):
(self.sr.rolling(self.wins).min())

def time_rolling_std(self):
(self.sr.rolling(self.wins).std())

def time_rolling_count(self):
(self.sr.rolling(self.wins).count())

def time_rolling_skew(self):
(self.sr.rolling(self.wins).skew())

def time_rolling_kurt(self):
(self.sr.rolling(self.wins).kurt())

def time_rolling_sum(self):
(self.sr.rolling(self.wins).sum())

def time_rolling_corr(self):
(self.srs.rolling(self.wins).corr())

def time_rolling_cov(self):
(self.srs.rolling(self.wins).cov())

def time_rolling_quantile_0_l(self):
(self.sr.rolling(self.winl).quantile(0.0))

def time_rolling_quantile_1_l(self):
(self.sr.rolling(self.winl).quantile(1.0))

def time_rolling_quantile_median_l(self):
(self.sr.rolling(self.winl).quantile(0.5))

def time_rolling_median_l(self):
(self.sr.rolling(self.winl).median())

def time_rolling_mean_l(self):
(self.sr.rolling(self.winl).mean())

def time_rolling_max_l(self):
(self.sr.rolling(self.winl).max())

def time_rolling_min_l(self):
(self.sr.rolling(self.winl).min())

def time_rolling_std_l(self):
(self.sr.rolling(self.wins).std())

def time_rolling_count_l(self):
(self.sr.rolling(self.wins).count())

def time_rolling_skew_l(self):
(self.sr.rolling(self.wins).skew())

def time_rolling_kurt_l(self):
(self.sr.rolling(self.wins).kurt())

def time_rolling_sum_l(self):
(self.sr.rolling(self.wins).sum())
8 changes: 8 additions & 0 deletions asv_bench/benchmarks/sparse.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from itertools import repeat

from .pandas_vb_common import *
import scipy.sparse
from pandas import SparseSeries, SparseDataFrame
Expand Down Expand Up @@ -27,6 +29,12 @@ class sparse_frame_constructor(object):
def time_sparse_frame_constructor(self):
SparseDataFrame(columns=np.arange(100), index=np.arange(1000))

def time_sparse_from_scipy(self):
SparseDataFrame(scipy.sparse.rand(1000, 1000, 0.005))

def time_sparse_from_dict(self):
SparseDataFrame(dict(zip(range(1000), repeat([0]))))


class sparse_series_from_coo(object):
goal_time = 0.2
Expand Down
6 changes: 3 additions & 3 deletions asv_bench/vbench_to_asv.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def translate_module(target_module):
l_vars = {}
exec('import ' + target_module) in g_vars

print target_module
print(target_module)
module = eval(target_module, g_vars)

benchmarks = []
Expand Down Expand Up @@ -157,7 +157,7 @@ def translate_module(target_module):
mod = os.path.basename(module)
if mod in ['make.py', 'measure_memory_consumption.py', 'perf_HEAD.py', 'run_suite.py', 'test_perf.py', 'generate_rst_files.py', 'test.py', 'suite.py']:
continue
print
print mod
print('')
print(mod)

translate_module(mod.replace('.py', ''))
22 changes: 0 additions & 22 deletions bench/alignment.py

This file was deleted.

14 changes: 0 additions & 14 deletions bench/bench_dense_to_sparse.py

This file was deleted.

56 changes: 0 additions & 56 deletions bench/bench_get_put_value.py

This file was deleted.

Loading

0 comments on commit 0e2d315

Please sign in to comment.