Skip to content

Commit

Permalink
Merge branch 'master' into update-groupby
Browse files Browse the repository at this point in the history
  • Loading branch information
proost authored Sep 14, 2019
2 parents 892126f + ad9fe5d commit 5b89726
Show file tree
Hide file tree
Showing 274 changed files with 5,072 additions and 2,342 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ dist
# wheel files
*.whl
**/wheelhouse/*
pip-wheel-metadata
# coverage
.coverage
coverage.xml
Expand Down
32 changes: 16 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
repos:
- repo: https://github.com/python/black
rev: stable
hooks:
- id: black
language_version: python3.7
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.7
hooks:
- id: flake8
language: python_venv
additional_dependencies: [flake8-comprehensions]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.20
hooks:
- id: isort
language: python_venv
- repo: https://github.com/python/black
rev: stable
hooks:
- id: black
language_version: python3.7
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.7
hooks:
- id: flake8
language: python_venv
additional_dependencies: [flake8-comprehensions]
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.20
hooks:
- id: isort
language: python_venv
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include LICENSE
include RELEASE.md
include README.md
include setup.py
include pyproject.toml

graft doc
prune doc/build
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ black:
black . --exclude '(asv_bench/env|\.egg|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist|setup.py)'

develop: build
python setup.py develop
python -m pip install --no-build-isolation -e .

doc:
-rm -rf doc/build doc/source/generated
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,16 +188,17 @@ python setup.py install

or for installing in [development mode](https://pip.pypa.io/en/latest/reference/pip_install.html#editable-installs):


```sh
python setup.py develop
python -m pip install --no-build-isolation -e .
```

Alternatively, you can use `pip` if you want all the dependencies pulled
in automatically (the `-e` option is for installing it in [development
mode](https://pip.pypa.io/en/latest/reference/pip_install.html#editable-installs)):
If you have `make`, you can also use `make develop` to run the same command.

or alternatively

```sh
pip install -e .
python setup.py develop
```

See the full instructions for [installing from source](https://pandas.pydata.org/pandas-docs/stable/install.html#installing-from-source).
Expand Down
3 changes: 2 additions & 1 deletion asv_bench/asv.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@
"xlsxwriter": [],
"xlrd": [],
"xlwt": [],
"odfpy": [],
"pytest": [],
// If using Windows with python 2.7 and want to build using the
// mingw toolchain (rather than MSVC), uncomment the following line.
// "libpython": [],
},

"conda_channels": ["defaults", "conda-forge"],
// Combinations of libraries/python versions can be excluded/included
// from the set to test. Each entry is a dictionary containing additional
// key-value pairs to include/exclude.
Expand Down
3 changes: 2 additions & 1 deletion asv_bench/benchmarks/attrs_caching.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

from pandas import DataFrame

try:
Expand Down Expand Up @@ -32,4 +33,4 @@ def time_cache_readonly(self):
self.obj.prop


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
3 changes: 2 additions & 1 deletion asv_bench/benchmarks/binary_ops.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

from pandas import DataFrame, Series, date_range
from pandas.core.algorithms import checked_add_with_arr

Expand Down Expand Up @@ -155,4 +156,4 @@ def time_add_overflow_both_arg_nan(self):
)


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
6 changes: 4 additions & 2 deletions asv_bench/benchmarks/categoricals.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import warnings

import numpy as np

import pandas as pd
import pandas.util.testing as tm
import warnings

try:
from pandas.api.types import union_categoricals
Expand Down Expand Up @@ -280,4 +282,4 @@ def time_sort_values(self):
self.index.sort_values(ascending=False)


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/ctors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np

from pandas import DatetimeIndex, Index, MultiIndex, Series, Timestamp
import pandas.util.testing as tm
from pandas import Series, Index, DatetimeIndex, Timestamp, MultiIndex


def no_change(arr):
Expand Down Expand Up @@ -113,4 +114,4 @@ def time_multiindex_from_iterables(self):
MultiIndex.from_product(self.iterables)


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
10 changes: 5 additions & 5 deletions asv_bench/benchmarks/dtypes.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import numpy as np

from pandas.api.types import pandas_dtype

import numpy as np
from .pandas_vb_common import (
numeric_dtypes,
datetime_dtypes,
string_dtypes,
extension_dtypes,
numeric_dtypes,
string_dtypes,
)


_numpy_dtypes = [
np.dtype(dtype) for dtype in (numeric_dtypes + datetime_dtypes + string_dtypes)
]
Expand Down Expand Up @@ -40,4 +40,4 @@ def time_pandas_dtype_invalid(self, dtype):
pass


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
3 changes: 2 additions & 1 deletion asv_bench/benchmarks/eval.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np

import pandas as pd

try:
Expand Down Expand Up @@ -62,4 +63,4 @@ def time_query_with_boolean_selection(self):
self.df.query("(a >= @self.min_val) & (a <= @self.max_val)")


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
5 changes: 3 additions & 2 deletions asv_bench/benchmarks/frame_ctor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np

from pandas import DataFrame, MultiIndex, Series, Timestamp, date_range
import pandas.util.testing as tm
from pandas import DataFrame, Series, MultiIndex, Timestamp, date_range

try:
from pandas.tseries.offsets import Nano, Hour
Expand Down Expand Up @@ -104,4 +105,4 @@ def time_frame_from_lists(self):
self.df = DataFrame(self.data)


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
4 changes: 2 additions & 2 deletions asv_bench/benchmarks/frame_methods.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import warnings
import string
import warnings

import numpy as np

Expand Down Expand Up @@ -609,4 +609,4 @@ def time_dataframe_describe(self):
self.df.describe()


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
9 changes: 5 additions & 4 deletions asv_bench/benchmarks/gil.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import numpy as np
import pandas.util.testing as tm
from pandas import DataFrame, Series, read_csv, factorize, date_range

from pandas import DataFrame, Series, date_range, factorize, read_csv
from pandas.core.algorithms import take_1d
import pandas.util.testing as tm

try:
from pandas import (
Expand Down Expand Up @@ -36,7 +37,7 @@ def wrapper(fname):
return wrapper


from .pandas_vb_common import BaseIO
from .pandas_vb_common import BaseIO # noqa: E402 isort:skip


class ParallelGroupbyMethods:
Expand Down Expand Up @@ -301,4 +302,4 @@ def time_loop(self, threads):
self.loop()


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
3 changes: 1 addition & 2 deletions asv_bench/benchmarks/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
)
import pandas.util.testing as tm


method_blacklist = {
"object": {
"median",
Expand Down Expand Up @@ -626,4 +625,4 @@ def time_first(self):
self.df_nans.groupby("key").transform("first")


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
14 changes: 8 additions & 6 deletions asv_bench/benchmarks/index_object.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import gc

import numpy as np
import pandas.util.testing as tm

from pandas import (
Series,
date_range,
DatetimeIndex,
Index,
RangeIndex,
Float64Index,
Index,
IntervalIndex,
RangeIndex,
Series,
date_range,
)
import pandas.util.testing as tm


class SetOperations:
Expand Down Expand Up @@ -243,4 +245,4 @@ def peakmem_gc_instances(self, N):
gc.enable()


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
17 changes: 9 additions & 8 deletions asv_bench/benchmarks/indexing.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import warnings

import numpy as np
import pandas.util.testing as tm

from pandas import (
Series,
CategoricalIndex,
DataFrame,
MultiIndex,
Int64Index,
UInt64Index,
Float64Index,
IntervalIndex,
CategoricalIndex,
IndexSlice,
Int64Index,
IntervalIndex,
MultiIndex,
Series,
UInt64Index,
concat,
date_range,
option_context,
period_range,
)
import pandas.util.testing as tm


class NumericSeriesIndexing:
Expand Down Expand Up @@ -371,4 +372,4 @@ def time_chained_indexing(self, mode):
df2["C"] = 1.0


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
7 changes: 4 additions & 3 deletions asv_bench/benchmarks/inference.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import numpy as np
import pandas.util.testing as tm

from pandas import DataFrame, Series, to_numeric
import pandas.util.testing as tm

from .pandas_vb_common import numeric_dtypes, lib
from .pandas_vb_common import lib, numeric_dtypes


class NumericInferOps:
Expand Down Expand Up @@ -120,4 +121,4 @@ def time_convert(self, data):
lib.maybe_convert_numeric(data, set(), coerce_numeric=False)


from .pandas_vb_common import setup # noqa: F401
from .pandas_vb_common import setup # noqa: F401 isort:skip
7 changes: 4 additions & 3 deletions asv_bench/benchmarks/io/csv.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from io import StringIO
import random
import string

import numpy as np

from pandas import Categorical, DataFrame, date_range, read_csv, to_datetime
import pandas.util.testing as tm
from pandas import DataFrame, Categorical, date_range, read_csv, to_datetime
from io import StringIO

from ..pandas_vb_common import BaseIO

Expand Down Expand Up @@ -406,4 +407,4 @@ def time_to_datetime_format_DD_MM_YYYY(self, cache_dates):
to_datetime(df["date"], cache=cache_dates, format="%d-%m-%Y")


from ..pandas_vb_common import setup # noqa: F401
from ..pandas_vb_common import setup # noqa: F401 isort:skip
Loading

0 comments on commit 5b89726

Please sign in to comment.