Skip to content

Commit c9dea18

Browse files
committed
Merge for update
2 parents 0e07474 + d48306e commit c9dea18

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1377
-532
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.PHONY : develop build clean clean_pyc doc lint-diff black
22

3+
all: develop
4+
35
clean:
46
-python setup.py clean
57

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import pandas as pd
2+
3+
4+
class IndexCache:
5+
number = 1
6+
repeat = (3, 100, 20)
7+
8+
params = [
9+
[
10+
"DatetimeIndex",
11+
"Float64Index",
12+
"IntervalIndex",
13+
"Int64Index",
14+
"MultiIndex",
15+
"PeriodIndex",
16+
"RangeIndex",
17+
"TimedeltaIndex",
18+
"UInt64Index",
19+
]
20+
]
21+
param_names = ["index_type"]
22+
23+
def setup(self, index_type):
24+
N = 10 ** 5
25+
if index_type == "MultiIndex":
26+
self.idx = pd.MultiIndex.from_product(
27+
[pd.date_range("1/1/2000", freq="T", periods=N // 2), ["a", "b"]]
28+
)
29+
elif index_type == "DatetimeIndex":
30+
self.idx = pd.date_range("1/1/2000", freq="T", periods=N)
31+
elif index_type == "Int64Index":
32+
self.idx = pd.Index(range(N))
33+
elif index_type == "PeriodIndex":
34+
self.idx = pd.period_range("1/1/2000", freq="T", periods=N)
35+
elif index_type == "RangeIndex":
36+
self.idx = pd.RangeIndex(start=0, stop=N)
37+
elif index_type == "IntervalIndex":
38+
self.idx = pd.IntervalIndex.from_arrays(range(N), range(1, N + 1))
39+
elif index_type == "TimedeltaIndex":
40+
self.idx = pd.TimedeltaIndex(range(N))
41+
elif index_type == "Float64Index":
42+
self.idx = pd.Float64Index(range(N))
43+
elif index_type == "UInt64Index":
44+
self.idx = pd.UInt64Index(range(N))
45+
else:
46+
raise ValueError
47+
assert len(self.idx) == N
48+
self.idx._cache = {}
49+
50+
def time_values(self, index_type):
51+
self.idx._values
52+
53+
def time_shape(self, index_type):
54+
self.idx.shape
55+
56+
def time_is_monotonic(self, index_type):
57+
self.idx.is_monotonic
58+
59+
def time_is_monotonic_decreasing(self, index_type):
60+
self.idx.is_monotonic_decreasing
61+
62+
def time_is_monotonic_increasing(self, index_type):
63+
self.idx.is_monotonic_increasing
64+
65+
def time_is_unique(self, index_type):
66+
self.idx.is_unique
67+
68+
def time_engine(self, index_type):
69+
self.idx._engine
70+
71+
def time_inferred_type(self, index_type):
72+
self.idx.inferred_type
73+
74+
def time_is_all_dates(self, index_type):
75+
self.idx.is_all_dates

asv_bench/benchmarks/io/parsers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
pass
1111

1212

13-
class DoesStringLookLikeDatetime(object):
13+
class DoesStringLookLikeDatetime:
1414

1515
params = (["2Q2005", "0.0", "10000"],)
1616
param_names = ["value"]
@@ -23,7 +23,7 @@ def time_check_datetimes(self, value):
2323
_does_string_look_like_datetime(obj)
2424

2525

26-
class ConcatDateCols(object):
26+
class ConcatDateCols:
2727

2828
params = ([1234567890, "AAAA"], [1, 2])
2929
param_names = ["value", "dim"]

asv_bench/benchmarks/reshape.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,17 @@ def time_qcut_datetime(self, bins):
240240
pd.qcut(self.datetime_series, bins)
241241

242242

243+
class Explode:
244+
param_names = ["n_rows", "max_list_length"]
245+
params = [[100, 1000, 10000], [3, 5, 10]]
246+
247+
def setup(self, n_rows, max_list_length):
248+
249+
data = [np.arange(np.random.randint(max_list_length)) for _ in range(n_rows)]
250+
self.series = pd.Series(data)
251+
252+
def time_explode(self, n_rows, max_list_length):
253+
self.series.explode()
254+
255+
243256
from .pandas_vb_common import setup # noqa: F401

asv_bench/benchmarks/series_methods.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def time_series_datetimeindex_repr(self):
219219
getattr(self.s, "a", None)
220220

221221

222-
class All(object):
222+
class All:
223223

224224
params = [[10 ** 3, 10 ** 6], ["fast", "slow"]]
225225
param_names = ["N", "case"]
@@ -232,7 +232,7 @@ def time_all(self, N, case):
232232
self.s.all()
233233

234234

235-
class Any(object):
235+
class Any:
236236

237237
params = [[10 ** 3, 10 ** 6], ["fast", "slow"]]
238238
param_names = ["N", "case"]
@@ -245,7 +245,7 @@ def time_any(self, N, case):
245245
self.s.any()
246246

247247

248-
class NanOps(object):
248+
class NanOps:
249249

250250
params = [
251251
[

asv_bench/benchmarks/timeseries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ def time_format_YYYYMMDD(self):
293293
to_datetime(self.stringsD, format="%Y%m%d")
294294

295295

296-
class ToDatetimeCacheSmallCount(object):
296+
class ToDatetimeCacheSmallCount:
297297

298298
params = ([True, False], [50, 500, 5000, 100000])
299299
param_names = ["cache", "count"]

ci/azure/posix.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ jobs:
3333
PATTERN: "not slow and not network"
3434
LOCALE_OVERRIDE: "it_IT.UTF-8"
3535

36+
py36_32bit:
37+
ENV_FILE: ci/deps/azure-36-32bit.yaml
38+
CONDA_PY: "36"
39+
PATTERN: "not slow and not network"
40+
BITS32: "yes"
41+
3642
py37_locale:
3743
ENV_FILE: ci/deps/azure-37-locale.yaml
3844
CONDA_PY: "37"

ci/code_checks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ if [[ -z "$CHECK" || "$CHECK" == "patterns" ]]; then
156156
RET=$(($RET + $?)) ; echo $MSG "DONE"
157157

158158
MSG='Check for python2 new-style classes and for empty parentheses' ; echo $MSG
159-
invgrep -R --include="*.py" --include="*.pyx" -E "class\s\S*\((object)?\):" pandas scripts
159+
invgrep -R --include="*.py" --include="*.pyx" -E "class\s\S*\((object)?\):" pandas asv_bench/benchmarks scripts
160160
RET=$(($RET + $?)) ; echo $MSG "DONE"
161161

162162
MSG='Check for backticks incorrectly rendering because of missing spaces' ; echo $MSG

ci/deps/azure-36-32bit.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: pandas-dev
2+
channels:
3+
- defaults
4+
- conda-forge
5+
dependencies:
6+
- gcc_linux-32
7+
- gcc_linux-32
8+
- gxx_linux-32
9+
- cython=0.28.2
10+
- numpy=1.14.*
11+
- python-dateutil
12+
- python=3.6.*
13+
- pytz=2017.2
14+
# universal
15+
- pytest>=4.0.2,<5.0.0
16+
- pytest-xdist
17+
- pytest-mock
18+
- pytest-azurepipelines
19+
- hypothesis>=3.58.0
20+
- pip

ci/deps/azure-37-numpydev.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ dependencies:
1717
- "--pre"
1818
- "numpy"
1919
- "scipy"
20-
- pytest-azurepipelines
20+
# https://github.com/pandas-dev/pandas/issues/27421
21+
- pytest-azurepipelines<1.0.0

0 commit comments

Comments
 (0)