Skip to content

Commit a1a1cb2

Browse files
authored
Merge pull request #3 from pandas-dev/master
updates from upstream
2 parents 9e9f0c3 + 6620dc6 commit a1a1cb2

File tree

594 files changed

+47567
-14877
lines changed

Some content is hidden

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

594 files changed

+47567
-14877
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -125,35 +125,32 @@ jobs:
125125
- name: Check ipython directive errors
126126
run: "! grep -B1 \"^<<<-------------------------------------------------------------------------$\" sphinx.log"
127127

128-
- name: Merge website and docs
129-
run: |
130-
mkdir -p pandas_web/docs
131-
cp -r web/build/* pandas_web/
132-
cp -r doc/build/html/* pandas_web/docs/
133-
if: github.event_name == 'push'
134-
135128
- name: Install Rclone
136129
run: sudo apt install rclone -y
137130
if: github.event_name == 'push'
138131

139132
- name: Set up Rclone
140133
run: |
141-
RCLONE_CONFIG_PATH=$HOME/.config/rclone/rclone.conf
142-
mkdir -p `dirname $RCLONE_CONFIG_PATH`
143-
echo "[ovh_cloud_pandas_web]" > $RCLONE_CONFIG_PATH
144-
echo "type = swift" >> $RCLONE_CONFIG_PATH
145-
echo "env_auth = false" >> $RCLONE_CONFIG_PATH
146-
echo "auth_version = 3" >> $RCLONE_CONFIG_PATH
147-
echo "auth = https://auth.cloud.ovh.net/v3/" >> $RCLONE_CONFIG_PATH
148-
echo "endpoint_type = public" >> $RCLONE_CONFIG_PATH
149-
echo "tenant_domain = default" >> $RCLONE_CONFIG_PATH
150-
echo "tenant = 2977553886518025" >> $RCLONE_CONFIG_PATH
151-
echo "domain = default" >> $RCLONE_CONFIG_PATH
152-
echo "user = w4KGs3pmDxpd" >> $RCLONE_CONFIG_PATH
153-
echo "key = ${{ secrets.ovh_object_store_key }}" >> $RCLONE_CONFIG_PATH
154-
echo "region = BHS" >> $RCLONE_CONFIG_PATH
134+
CONF=$HOME/.config/rclone/rclone.conf
135+
mkdir -p `dirname $CONF`
136+
echo "[ovh_host]" > $CONF
137+
echo "type = swift" >> $CONF
138+
echo "env_auth = false" >> $CONF
139+
echo "auth_version = 3" >> $CONF
140+
echo "auth = https://auth.cloud.ovh.net/v3/" >> $CONF
141+
echo "endpoint_type = public" >> $CONF
142+
echo "tenant_domain = default" >> $CONF
143+
echo "tenant = 2977553886518025" >> $CONF
144+
echo "domain = default" >> $CONF
145+
echo "user = w4KGs3pmDxpd" >> $CONF
146+
echo "key = ${{ secrets.ovh_object_store_key }}" >> $CONF
147+
echo "region = BHS" >> $CONF
148+
if: github.event_name == 'push'
149+
150+
- name: Sync web with OVH
151+
run: rclone sync --exclude pandas-docs/** web/build ovh_host:prod
155152
if: github.event_name == 'push'
156153

157-
- name: Sync web
158-
run: rclone sync pandas_web ovh_cloud_pandas_web:dev
154+
- name: Sync dev docs with OVH
155+
run: rclone sync doc/build/html ovh_host:prod/pandas-docs/dev
159156
if: github.event_name == 'push'

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ repos:
1010
- id: flake8
1111
language: python_venv
1212
additional_dependencies: [flake8-comprehensions>=3.1.0]
13+
- id: flake8
14+
name: flake8-pyx
15+
language: python_venv
16+
files: \.(pyx|pxd)$
17+
types:
18+
- file
19+
args: [--append-config=flake8/cython.cfg]
20+
- id: flake8
21+
name: flake8-pxd
22+
language: python_venv
23+
files: \.pxi\.in$
24+
types:
25+
- file
26+
args: [--append-config=flake8/cython-template.cfg]
1327
- repo: https://github.com/pre-commit/mirrors-isort
1428
rev: v4.3.21
1529
hooks:

asv_bench/benchmarks/algorithms.py

Lines changed: 35 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -31,83 +31,62 @@ def time_maybe_convert_objects(self):
3131

3232
class Factorize:
3333

34-
params = [[True, False], ["int", "uint", "float", "string"]]
35-
param_names = ["sort", "dtype"]
36-
37-
def setup(self, sort, dtype):
38-
N = 10 ** 5
39-
data = {
40-
"int": pd.Int64Index(np.arange(N).repeat(5)),
41-
"uint": pd.UInt64Index(np.arange(N).repeat(5)),
42-
"float": pd.Float64Index(np.random.randn(N).repeat(5)),
43-
"string": tm.makeStringIndex(N).repeat(5),
44-
}
45-
self.idx = data[dtype]
46-
47-
def time_factorize(self, sort, dtype):
48-
self.idx.factorize(sort=sort)
49-
50-
51-
class FactorizeUnique:
52-
53-
params = [[True, False], ["int", "uint", "float", "string"]]
54-
param_names = ["sort", "dtype"]
34+
params = [
35+
[True, False],
36+
[True, False],
37+
["int", "uint", "float", "string", "datetime64[ns]", "datetime64[ns, tz]"],
38+
]
39+
param_names = ["unique", "sort", "dtype"]
5540

56-
def setup(self, sort, dtype):
41+
def setup(self, unique, sort, dtype):
5742
N = 10 ** 5
5843
data = {
5944
"int": pd.Int64Index(np.arange(N)),
6045
"uint": pd.UInt64Index(np.arange(N)),
61-
"float": pd.Float64Index(np.arange(N)),
46+
"float": pd.Float64Index(np.random.randn(N)),
6247
"string": tm.makeStringIndex(N),
63-
}
64-
self.idx = data[dtype]
65-
assert self.idx.is_unique
66-
67-
def time_factorize(self, sort, dtype):
48+
"datetime64[ns]": pd.date_range("2011-01-01", freq="H", periods=N),
49+
"datetime64[ns, tz]": pd.date_range(
50+
"2011-01-01", freq="H", periods=N, tz="Asia/Tokyo"
51+
),
52+
}[dtype]
53+
if not unique:
54+
data = data.repeat(5)
55+
self.idx = data
56+
57+
def time_factorize(self, unique, sort, dtype):
6858
self.idx.factorize(sort=sort)
6959

7060

7161
class Duplicated:
7262

73-
params = [["first", "last", False], ["int", "uint", "float", "string"]]
74-
param_names = ["keep", "dtype"]
75-
76-
def setup(self, keep, dtype):
77-
N = 10 ** 5
78-
data = {
79-
"int": pd.Int64Index(np.arange(N).repeat(5)),
80-
"uint": pd.UInt64Index(np.arange(N).repeat(5)),
81-
"float": pd.Float64Index(np.random.randn(N).repeat(5)),
82-
"string": tm.makeStringIndex(N).repeat(5),
83-
}
84-
self.idx = data[dtype]
85-
# cache is_unique
86-
self.idx.is_unique
87-
88-
def time_duplicated(self, keep, dtype):
89-
self.idx.duplicated(keep=keep)
90-
91-
92-
class DuplicatedUniqueIndex:
93-
94-
params = ["int", "uint", "float", "string"]
95-
param_names = ["dtype"]
63+
params = [
64+
[True, False],
65+
["first", "last", False],
66+
["int", "uint", "float", "string", "datetime64[ns]", "datetime64[ns, tz]"],
67+
]
68+
param_names = ["unique", "keep", "dtype"]
9669

97-
def setup(self, dtype):
70+
def setup(self, unique, keep, dtype):
9871
N = 10 ** 5
9972
data = {
10073
"int": pd.Int64Index(np.arange(N)),
10174
"uint": pd.UInt64Index(np.arange(N)),
10275
"float": pd.Float64Index(np.random.randn(N)),
10376
"string": tm.makeStringIndex(N),
104-
}
105-
self.idx = data[dtype]
77+
"datetime64[ns]": pd.date_range("2011-01-01", freq="H", periods=N),
78+
"datetime64[ns, tz]": pd.date_range(
79+
"2011-01-01", freq="H", periods=N, tz="Asia/Tokyo"
80+
),
81+
}[dtype]
82+
if not unique:
83+
data = data.repeat(5)
84+
self.idx = data
10685
# cache is_unique
10786
self.idx.is_unique
10887

109-
def time_duplicated_unique(self, dtype):
110-
self.idx.duplicated()
88+
def time_duplicated(self, unique, keep, dtype):
89+
self.idx.duplicated(keep=keep)
11190

11291

11392
class Hashing:

0 commit comments

Comments
 (0)