Skip to content

Commit

Permalink
Merge pull request #3 from pandas-dev/master
Browse files Browse the repository at this point in the history
updates from upstream
  • Loading branch information
datajanko authored Mar 15, 2020
2 parents 9e9f0c3 + 6620dc6 commit a1a1cb2
Show file tree
Hide file tree
Showing 594 changed files with 47,567 additions and 14,877 deletions.
43 changes: 20 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,35 +125,32 @@ jobs:
- name: Check ipython directive errors
run: "! grep -B1 \"^<<<-------------------------------------------------------------------------$\" sphinx.log"

- name: Merge website and docs
run: |
mkdir -p pandas_web/docs
cp -r web/build/* pandas_web/
cp -r doc/build/html/* pandas_web/docs/
if: github.event_name == 'push'

- name: Install Rclone
run: sudo apt install rclone -y
if: github.event_name == 'push'

- name: Set up Rclone
run: |
RCLONE_CONFIG_PATH=$HOME/.config/rclone/rclone.conf
mkdir -p `dirname $RCLONE_CONFIG_PATH`
echo "[ovh_cloud_pandas_web]" > $RCLONE_CONFIG_PATH
echo "type = swift" >> $RCLONE_CONFIG_PATH
echo "env_auth = false" >> $RCLONE_CONFIG_PATH
echo "auth_version = 3" >> $RCLONE_CONFIG_PATH
echo "auth = https://auth.cloud.ovh.net/v3/" >> $RCLONE_CONFIG_PATH
echo "endpoint_type = public" >> $RCLONE_CONFIG_PATH
echo "tenant_domain = default" >> $RCLONE_CONFIG_PATH
echo "tenant = 2977553886518025" >> $RCLONE_CONFIG_PATH
echo "domain = default" >> $RCLONE_CONFIG_PATH
echo "user = w4KGs3pmDxpd" >> $RCLONE_CONFIG_PATH
echo "key = ${{ secrets.ovh_object_store_key }}" >> $RCLONE_CONFIG_PATH
echo "region = BHS" >> $RCLONE_CONFIG_PATH
CONF=$HOME/.config/rclone/rclone.conf
mkdir -p `dirname $CONF`
echo "[ovh_host]" > $CONF
echo "type = swift" >> $CONF
echo "env_auth = false" >> $CONF
echo "auth_version = 3" >> $CONF
echo "auth = https://auth.cloud.ovh.net/v3/" >> $CONF
echo "endpoint_type = public" >> $CONF
echo "tenant_domain = default" >> $CONF
echo "tenant = 2977553886518025" >> $CONF
echo "domain = default" >> $CONF
echo "user = w4KGs3pmDxpd" >> $CONF
echo "key = ${{ secrets.ovh_object_store_key }}" >> $CONF
echo "region = BHS" >> $CONF
if: github.event_name == 'push'

- name: Sync web with OVH
run: rclone sync --exclude pandas-docs/** web/build ovh_host:prod
if: github.event_name == 'push'

- name: Sync web
run: rclone sync pandas_web ovh_cloud_pandas_web:dev
- name: Sync dev docs with OVH
run: rclone sync doc/build/html ovh_host:prod/pandas-docs/dev
if: github.event_name == 'push'
14 changes: 14 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ repos:
- id: flake8
language: python_venv
additional_dependencies: [flake8-comprehensions>=3.1.0]
- id: flake8
name: flake8-pyx
language: python_venv
files: \.(pyx|pxd)$
types:
- file
args: [--append-config=flake8/cython.cfg]
- id: flake8
name: flake8-pxd
language: python_venv
files: \.pxi\.in$
types:
- file
args: [--append-config=flake8/cython-template.cfg]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
Expand Down
91 changes: 35 additions & 56 deletions asv_bench/benchmarks/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,83 +31,62 @@ def time_maybe_convert_objects(self):

class Factorize:

params = [[True, False], ["int", "uint", "float", "string"]]
param_names = ["sort", "dtype"]

def setup(self, sort, dtype):
N = 10 ** 5
data = {
"int": pd.Int64Index(np.arange(N).repeat(5)),
"uint": pd.UInt64Index(np.arange(N).repeat(5)),
"float": pd.Float64Index(np.random.randn(N).repeat(5)),
"string": tm.makeStringIndex(N).repeat(5),
}
self.idx = data[dtype]

def time_factorize(self, sort, dtype):
self.idx.factorize(sort=sort)


class FactorizeUnique:

params = [[True, False], ["int", "uint", "float", "string"]]
param_names = ["sort", "dtype"]
params = [
[True, False],
[True, False],
["int", "uint", "float", "string", "datetime64[ns]", "datetime64[ns, tz]"],
]
param_names = ["unique", "sort", "dtype"]

def setup(self, sort, dtype):
def setup(self, unique, sort, dtype):
N = 10 ** 5
data = {
"int": pd.Int64Index(np.arange(N)),
"uint": pd.UInt64Index(np.arange(N)),
"float": pd.Float64Index(np.arange(N)),
"float": pd.Float64Index(np.random.randn(N)),
"string": tm.makeStringIndex(N),
}
self.idx = data[dtype]
assert self.idx.is_unique

def time_factorize(self, sort, dtype):
"datetime64[ns]": pd.date_range("2011-01-01", freq="H", periods=N),
"datetime64[ns, tz]": pd.date_range(
"2011-01-01", freq="H", periods=N, tz="Asia/Tokyo"
),
}[dtype]
if not unique:
data = data.repeat(5)
self.idx = data

def time_factorize(self, unique, sort, dtype):
self.idx.factorize(sort=sort)


class Duplicated:

params = [["first", "last", False], ["int", "uint", "float", "string"]]
param_names = ["keep", "dtype"]

def setup(self, keep, dtype):
N = 10 ** 5
data = {
"int": pd.Int64Index(np.arange(N).repeat(5)),
"uint": pd.UInt64Index(np.arange(N).repeat(5)),
"float": pd.Float64Index(np.random.randn(N).repeat(5)),
"string": tm.makeStringIndex(N).repeat(5),
}
self.idx = data[dtype]
# cache is_unique
self.idx.is_unique

def time_duplicated(self, keep, dtype):
self.idx.duplicated(keep=keep)


class DuplicatedUniqueIndex:

params = ["int", "uint", "float", "string"]
param_names = ["dtype"]
params = [
[True, False],
["first", "last", False],
["int", "uint", "float", "string", "datetime64[ns]", "datetime64[ns, tz]"],
]
param_names = ["unique", "keep", "dtype"]

def setup(self, dtype):
def setup(self, unique, keep, dtype):
N = 10 ** 5
data = {
"int": pd.Int64Index(np.arange(N)),
"uint": pd.UInt64Index(np.arange(N)),
"float": pd.Float64Index(np.random.randn(N)),
"string": tm.makeStringIndex(N),
}
self.idx = data[dtype]
"datetime64[ns]": pd.date_range("2011-01-01", freq="H", periods=N),
"datetime64[ns, tz]": pd.date_range(
"2011-01-01", freq="H", periods=N, tz="Asia/Tokyo"
),
}[dtype]
if not unique:
data = data.repeat(5)
self.idx = data
# cache is_unique
self.idx.is_unique

def time_duplicated_unique(self, dtype):
self.idx.duplicated()
def time_duplicated(self, unique, keep, dtype):
self.idx.duplicated(keep=keep)


class Hashing:
Expand Down
Loading

0 comments on commit a1a1cb2

Please sign in to comment.