Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit b29dfc6
Author: Tom Augspurger <tom.w.augspurger@gmail.com>
Date:   Thu Aug 16 10:45:38 2018 -0500

    Support NDFrame.shift with EAs

    Uses take internally.

    Closes pandas-dev#22386

commit b5d81cf
Author: William Ayd <william.ayd@icloud.com>
Date:   Thu Aug 16 03:54:18 2018 -0700

    Bump pytest (pandas-dev#22320)

commit f07a790
Author: jbrockmendel <jbrockmendel@gmail.com>
Date:   Thu Aug 16 03:46:58 2018 -0700

    Make more of numpy_helper unnecessary (pandas-dev#22344)

commit 7b80d4d
Author: Graham Inggs <graham.inggs+github@gmail.com>
Date:   Thu Aug 16 12:43:02 2018 +0200

    Drop redundant TestLocale (pandas-dev#22349)

commit 6bcfc46
Author: Matthew Roeschke <emailformattr@gmail.com>
Date:   Thu Aug 16 03:32:31 2018 -0700

    Fix failing dateutil test (pandas-dev#22354)

commit 86e8f23
Author: jbrockmendel <jbrockmendel@gmail.com>
Date:   Thu Aug 16 03:08:09 2018 -0700

    remove last cython: nprofile comments (pandas-dev#22371)

commit 70e6f7c
Author: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Date:   Wed Aug 15 18:09:50 2018 +0200

    DOC: edit docstring example to prevent segfault (pandas-dev#21824) (pandas-dev#22368)
  • Loading branch information
TomAugspurger committed Aug 16, 2018
1 parent 3bcf57e commit 31d401f
Show file tree
Hide file tree
Showing 47 changed files with 111 additions and 88 deletions.
2 changes: 1 addition & 1 deletion ci/environment-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- flake8
- flake8-comprehensions
- moto
- pytest>=3.1
- pytest>=3.6
- python-dateutil>=2.5.0
- python=3
- pytz
Expand Down
2 changes: 1 addition & 1 deletion ci/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ NumPy
flake8
flake8-comprehensions
moto
pytest>=3.1
pytest>=3.6
python-dateutil>=2.5.0
pytz
setuptools>=24.2.0
Expand Down
12 changes: 6 additions & 6 deletions doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -652,13 +652,13 @@ Adding tests is one of the most common requests after code is pushed to *pandas*
it is worth getting in the habit of writing tests ahead of time so this is never an issue.

Like many packages, *pandas* uses `pytest
<http://doc.pytest.org/en/latest/>`_ and the convenient
<http://docs.pytest.org/en/latest/>`_ and the convenient
extensions in `numpy.testing
<http://docs.scipy.org/doc/numpy/reference/routines.testing.html>`_.

.. note::

The earliest supported pytest version is 3.1.0.
The earliest supported pytest version is 3.6.0.

Writing tests
~~~~~~~~~~~~~
Expand Down Expand Up @@ -702,7 +702,7 @@ Transitioning to ``pytest``
class TestReallyCoolFeature(object):
....
Going forward, we are moving to a more *functional* style using the `pytest <http://doc.pytest.org/en/latest/>`__ framework, which offers a richer testing
Going forward, we are moving to a more *functional* style using the `pytest <http://docs.pytest.org/en/latest/>`__ framework, which offers a richer testing
framework that will facilitate testing and developing. Thus, instead of writing test classes, we will write test functions like this:

.. code-block:: python
Expand Down Expand Up @@ -766,7 +766,7 @@ A test run of this yields
((pandas) bash-3.2$ pytest test_cool_feature.py -v
=========================== test session starts ===========================
platform darwin -- Python 3.6.2, pytest-3.2.1, py-1.4.31, pluggy-0.4.0
platform darwin -- Python 3.6.2, pytest-3.6.0, py-1.4.31, pluggy-0.4.0
collected 11 items
tester.py::test_dtypes[int8] PASSED
Expand All @@ -788,7 +788,7 @@ Tests that we have ``parametrized`` are now accessible via the test name, for ex
((pandas) bash-3.2$ pytest test_cool_feature.py -v -k int8
=========================== test session starts ===========================
platform darwin -- Python 3.6.2, pytest-3.2.1, py-1.4.31, pluggy-0.4.0
platform darwin -- Python 3.6.2, pytest-3.6.0, py-1.4.31, pluggy-0.4.0
collected 11 items
test_cool_feature.py::test_dtypes[int8] PASSED
Expand Down Expand Up @@ -837,7 +837,7 @@ On Windows, one can type::
This can significantly reduce the time it takes to locally run tests before
submitting a pull request.
For more, see the `pytest <http://doc.pytest.org/en/latest/>`_ documentation.
For more, see the `pytest <http://docs.pytest.org/en/latest/>`_ documentation.
.. versionadded:: 0.20.0
Expand Down
4 changes: 2 additions & 2 deletions doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,15 @@ pandas is equipped with an exhaustive set of unit tests, covering about 97% of
the code base as of this writing. To run it on your machine to verify that
everything is working (and that you have all of the dependencies, soft and hard,
installed), make sure you have `pytest
<http://doc.pytest.org/en/latest/>`__ and run:
<http://docs.pytest.org/en/latest/>`__ >= 3.6 and run:

::

>>> import pandas as pd
>>> pd.test()
running: pytest --skip-slow --skip-network C:\Users\TP\Anaconda3\envs\py36\lib\site-packages\pandas
============================= test session starts =============================
platform win32 -- Python 3.6.2, pytest-3.2.1, py-1.4.34, pluggy-0.4.0
platform win32 -- Python 3.6.2, pytest-3.6.0, py-1.4.34, pluggy-0.4.0
rootdir: C:\Users\TP\Documents\Python\pandasdev\pandas, inifile: setup.cfg
collected 12145 items / 3 skipped

Expand Down
5 changes: 5 additions & 0 deletions doc/source/whatsnew/v0.23.5.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ Fixed Regressions
-
-


Development
~~~~~~~~~~~
- The minimum required pytest version has been increased to 3.6 (:issue:`22319`)

.. _whatsnew_0235.bug_fixes:

Bug Fixes
Expand Down
1 change: 1 addition & 0 deletions doc/source/whatsnew/v0.24.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ ExtensionType Changes
- Added ``ExtensionDtype._is_numeric`` for controlling whether an extension dtype is considered numeric (:issue:`22290`).
- The ``ExtensionArray`` constructor, ``_from_sequence`` now take the keyword arg ``copy=False`` (:issue:`21185`)
- Bug in :meth:`Series.get` for ``Series`` using ``ExtensionArray`` and integer index (:issue:`21257`)
- :meth:`~Series.shift` now works with extension arrays, rather than raising an AttributeError (:isseu:`22386`)
- :meth:`Series.combine()` works correctly with :class:`~pandas.api.extensions.ExtensionArray` inside of :class:`Series` (:issue:`20825`)
- :meth:`Series.combine()` with scalar argument now works for any function type (:issue:`21248`)
- Added ``ExtensionDtype._is_numeric`` for controlling whether an extension dtype is considered numeric.
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/algos.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: profile=False
# -*- coding: utf-8 -*-

cimport cython
from cython cimport Py_ssize_t
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/groupby.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

cimport cython
from cython cimport Py_ssize_t
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/hashing.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: profile=False
# -*- coding: utf-8 -*-
# Translated from the reference implementation
# at https://github.com/veorq/SipHash

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/hashtable.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: profile=False
# -*- coding: utf-8 -*-

cimport cython

Expand Down
7 changes: 3 additions & 4 deletions pandas/_libs/index.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: profile=False
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta, date

cimport cython
Expand Down Expand Up @@ -319,15 +319,14 @@ cdef class IndexEngine:
# form the set of the results (like ismember)
members = np.empty(n, dtype=np.uint8)
for i in range(n):
val = util.get_value_1d(values, i)
val = values[i]
if val in stargets:
if val not in d:
d[val] = []
d[val].append(i)

for i in range(n_t):

val = util.get_value_1d(targets, i)
val = targets[i]

# found
if val in d:
Expand Down
3 changes: 2 additions & 1 deletion pandas/_libs/indexing.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# cython: profile=False
# -*- coding: utf-8 -*-


cdef class _NDFrameIndexerBase:
"""
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/join.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: profile=False
# -*- coding: utf-8 -*-

cimport cython
from cython cimport Py_ssize_t
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/khash.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False
from cpython cimport PyObject
from numpy cimport int64_t, uint64_t, int32_t, uint32_t, float64_t

Expand Down
6 changes: 3 additions & 3 deletions pandas/_libs/lib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ def infer_dtype(object value, bint skipna=False):

# try to use a valid value
for i in range(n):
val = util.get_value_1d(values, i)
val = values[i]

# do not use is_nul_datetimelike to keep
# np.datetime64('nat') and np.timedelta64('nat')
Expand Down Expand Up @@ -1240,7 +1240,7 @@ def infer_dtype(object value, bint skipna=False):
return 'interval'

for i in range(n):
val = util.get_value_1d(values, i)
val = values[i]
if (util.is_integer_object(val) and
not util.is_timedelta64_object(val) and
not util.is_datetime64_object(val)):
Expand Down Expand Up @@ -2255,7 +2255,7 @@ def fast_multiget(dict mapping, ndarray keys, default=np.nan):
keys = getattr(keys, 'values', keys)

for i in range(n):
val = util.get_value_1d(keys, i)
val = keys[i]
if val in mapping:
output[i] = mapping[val]
else:
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/missing.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from tslibs.nattype cimport is_null_datetimelike

Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/missing.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from cpython cimport PyFloat_Check, PyComplex_Check

Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/reduction.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False
from distutils.version import LooseVersion

from cython cimport Py_ssize_t
Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/reshape.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cython: profile=False
# -*- coding: utf-8 -*-

cimport cython
from cython cimport Py_ssize_t
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/skiplist.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from cython cimport Py_ssize_t

Expand Down
16 changes: 0 additions & 16 deletions pandas/_libs/src/numpy_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,4 @@ PANDAS_INLINE PyObject* get_value_1d(PyArrayObject* ap, Py_ssize_t i) {
return PyArray_Scalar(item, PyArray_DESCR(ap), (PyObject*)ap);
}

// returns ASCII or UTF8 (py3) view on python str
// python object owns memory, should not be freed
PANDAS_INLINE const char* get_c_string(PyObject* obj) {
#if PY_VERSION_HEX >= 0x03000000
return PyUnicode_AsUTF8(obj);
#else
return PyString_AsString(obj);
#endif
}

void set_array_not_contiguous(PyArrayObject* ao) {
// Numpy>=1.8-compliant equivalent to:
// ao->flags &= ~(NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_F_CONTIGUOUS);
PyArray_CLEARFLAGS(ao, (NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_F_CONTIGUOUS));
}

#endif // PANDAS__LIBS_SRC_NUMPY_HELPER_H_
1 change: 0 additions & 1 deletion pandas/_libs/tslib.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False
from cython cimport Py_ssize_t

from cpython cimport PyFloat_Check, PyUnicode_Check
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/ccalendar.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from cython cimport Py_ssize_t

Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/ccalendar.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False
# cython: boundscheck=False
"""
Cython implementations of functions resembling the stdlib calendar module
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/conversion.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from cpython.datetime cimport datetime, tzinfo

Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/conversion.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

cimport cython
from cython cimport Py_ssize_t
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/fields.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False
"""
Functions for accessing attributes of Timestamp/datetime64/datetime-like
objects and arrays
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/frequencies.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

cpdef object get_rule_month(object source, object default=*)

Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/nattype.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from numpy cimport int64_t
cdef int64_t NPY_NAT
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/nattype.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from cpython cimport (
PyFloat_Check, PyComplex_Check,
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/np_datetime.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from cpython.datetime cimport date, datetime

Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/np_datetime.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from cpython cimport (Py_EQ, Py_NE, Py_GE, Py_GT, Py_LT, Py_LE,
PyUnicode_Check, PyUnicode_AsASCIIString)
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/timedeltas.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from numpy cimport int64_t

Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False
import collections
import textwrap
import warnings
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/timestamps.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from numpy cimport int64_t
from np_datetime cimport npy_datetimestruct
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/timestamps.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False
import warnings

from cpython cimport (PyObject_RichCompareBool, PyObject_RichCompare,
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/timezones.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

cdef bint is_utc(object tz)
cdef bint is_tzlocal(object tz)
Expand Down
1 change: 0 additions & 1 deletion pandas/_libs/tslibs/timezones.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
# cython: profile=False

from cython cimport Py_ssize_t

Expand Down
Loading

0 comments on commit 31d401f

Please sign in to comment.