Skip to content

Commit 31d401f

Browse files
committed
Squashed commit of the following:
commit b29dfc6 Author: Tom Augspurger <[email protected]> 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 <[email protected]> Date: Thu Aug 16 03:54:18 2018 -0700 Bump pytest (pandas-dev#22320) commit f07a790 Author: jbrockmendel <[email protected]> Date: Thu Aug 16 03:46:58 2018 -0700 Make more of numpy_helper unnecessary (pandas-dev#22344) commit 7b80d4d Author: Graham Inggs <[email protected]> Date: Thu Aug 16 12:43:02 2018 +0200 Drop redundant TestLocale (pandas-dev#22349) commit 6bcfc46 Author: Matthew Roeschke <[email protected]> Date: Thu Aug 16 03:32:31 2018 -0700 Fix failing dateutil test (pandas-dev#22354) commit 86e8f23 Author: jbrockmendel <[email protected]> Date: Thu Aug 16 03:08:09 2018 -0700 remove last cython: nprofile comments (pandas-dev#22371) commit 70e6f7c Author: Joris Van den Bossche <[email protected]> Date: Wed Aug 15 18:09:50 2018 +0200 DOC: edit docstring example to prevent segfault (pandas-dev#21824) (pandas-dev#22368)
1 parent 3bcf57e commit 31d401f

Some content is hidden

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

47 files changed

+111
-88
lines changed

ci/environment-dev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
- flake8
99
- flake8-comprehensions
1010
- moto
11-
- pytest>=3.1
11+
- pytest>=3.6
1212
- python-dateutil>=2.5.0
1313
- python=3
1414
- pytz

ci/requirements_dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ NumPy
55
flake8
66
flake8-comprehensions
77
moto
8-
pytest>=3.1
8+
pytest>=3.6
99
python-dateutil>=2.5.0
1010
pytz
1111
setuptools>=24.2.0

doc/source/contributing.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -652,13 +652,13 @@ Adding tests is one of the most common requests after code is pushed to *pandas*
652652
it is worth getting in the habit of writing tests ahead of time so this is never an issue.
653653

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

659659
.. note::
660660

661-
The earliest supported pytest version is 3.1.0.
661+
The earliest supported pytest version is 3.6.0.
662662

663663
Writing tests
664664
~~~~~~~~~~~~~
@@ -702,7 +702,7 @@ Transitioning to ``pytest``
702702
class TestReallyCoolFeature(object):
703703
....
704704
705-
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
705+
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
706706
framework that will facilitate testing and developing. Thus, instead of writing test classes, we will write test functions like this:
707707

708708
.. code-block:: python
@@ -766,7 +766,7 @@ A test run of this yields
766766
767767
((pandas) bash-3.2$ pytest test_cool_feature.py -v
768768
=========================== test session starts ===========================
769-
platform darwin -- Python 3.6.2, pytest-3.2.1, py-1.4.31, pluggy-0.4.0
769+
platform darwin -- Python 3.6.2, pytest-3.6.0, py-1.4.31, pluggy-0.4.0
770770
collected 11 items
771771
772772
tester.py::test_dtypes[int8] PASSED
@@ -788,7 +788,7 @@ Tests that we have ``parametrized`` are now accessible via the test name, for ex
788788
789789
((pandas) bash-3.2$ pytest test_cool_feature.py -v -k int8
790790
=========================== test session starts ===========================
791-
platform darwin -- Python 3.6.2, pytest-3.2.1, py-1.4.31, pluggy-0.4.0
791+
platform darwin -- Python 3.6.2, pytest-3.6.0, py-1.4.31, pluggy-0.4.0
792792
collected 11 items
793793
794794
test_cool_feature.py::test_dtypes[int8] PASSED
@@ -837,7 +837,7 @@ On Windows, one can type::
837837
This can significantly reduce the time it takes to locally run tests before
838838
submitting a pull request.
839839
840-
For more, see the `pytest <http://doc.pytest.org/en/latest/>`_ documentation.
840+
For more, see the `pytest <http://docs.pytest.org/en/latest/>`_ documentation.
841841
842842
.. versionadded:: 0.20.0
843843

doc/source/install.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,15 @@ pandas is equipped with an exhaustive set of unit tests, covering about 97% of
202202
the code base as of this writing. To run it on your machine to verify that
203203
everything is working (and that you have all of the dependencies, soft and hard,
204204
installed), make sure you have `pytest
205-
<http://doc.pytest.org/en/latest/>`__ and run:
205+
<http://docs.pytest.org/en/latest/>`__ >= 3.6 and run:
206206

207207
::
208208

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

doc/source/whatsnew/v0.23.5.txt

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ Fixed Regressions
2626
-
2727
-
2828

29+
30+
Development
31+
~~~~~~~~~~~
32+
- The minimum required pytest version has been increased to 3.6 (:issue:`22319`)
33+
2934
.. _whatsnew_0235.bug_fixes:
3035

3136
Bug Fixes

doc/source/whatsnew/v0.24.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ ExtensionType Changes
462462
- Added ``ExtensionDtype._is_numeric`` for controlling whether an extension dtype is considered numeric (:issue:`22290`).
463463
- The ``ExtensionArray`` constructor, ``_from_sequence`` now take the keyword arg ``copy=False`` (:issue:`21185`)
464464
- Bug in :meth:`Series.get` for ``Series`` using ``ExtensionArray`` and integer index (:issue:`21257`)
465+
- :meth:`~Series.shift` now works with extension arrays, rather than raising an AttributeError (:isseu:`22386`)
465466
- :meth:`Series.combine()` works correctly with :class:`~pandas.api.extensions.ExtensionArray` inside of :class:`Series` (:issue:`20825`)
466467
- :meth:`Series.combine()` with scalar argument now works for any function type (:issue:`21248`)
467468
- Added ``ExtensionDtype._is_numeric`` for controlling whether an extension dtype is considered numeric.

pandas/_libs/algos.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cython: profile=False
1+
# -*- coding: utf-8 -*-
22

33
cimport cython
44
from cython cimport Py_ssize_t

pandas/_libs/groupby.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
cimport cython
54
from cython cimport Py_ssize_t

pandas/_libs/hashing.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cython: profile=False
1+
# -*- coding: utf-8 -*-
22
# Translated from the reference implementation
33
# at https://github.com/veorq/SipHash
44

pandas/_libs/hashtable.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cython: profile=False
1+
# -*- coding: utf-8 -*-
22

33
cimport cython
44

pandas/_libs/index.pyx

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cython: profile=False
1+
# -*- coding: utf-8 -*-
22
from datetime import datetime, timedelta, date
33

44
cimport cython
@@ -319,15 +319,14 @@ cdef class IndexEngine:
319319
# form the set of the results (like ismember)
320320
members = np.empty(n, dtype=np.uint8)
321321
for i in range(n):
322-
val = util.get_value_1d(values, i)
322+
val = values[i]
323323
if val in stargets:
324324
if val not in d:
325325
d[val] = []
326326
d[val].append(i)
327327

328328
for i in range(n_t):
329-
330-
val = util.get_value_1d(targets, i)
329+
val = targets[i]
331330

332331
# found
333332
if val in d:

pandas/_libs/indexing.pyx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# cython: profile=False
1+
# -*- coding: utf-8 -*-
2+
23

34
cdef class _NDFrameIndexerBase:
45
"""

pandas/_libs/join.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cython: profile=False
1+
# -*- coding: utf-8 -*-
22

33
cimport cython
44
from cython cimport Py_ssize_t

pandas/_libs/khash.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32
from cpython cimport PyObject
43
from numpy cimport int64_t, uint64_t, int32_t, uint32_t, float64_t
54

pandas/_libs/lib.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ def infer_dtype(object value, bint skipna=False):
11531153

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

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

12421242
for i in range(n):
1243-
val = util.get_value_1d(values, i)
1243+
val = values[i]
12441244
if (util.is_integer_object(val) and
12451245
not util.is_timedelta64_object(val) and
12461246
not util.is_datetime64_object(val)):
@@ -2255,7 +2255,7 @@ def fast_multiget(dict mapping, ndarray keys, default=np.nan):
22552255
keys = getattr(keys, 'values', keys)
22562256

22572257
for i in range(n):
2258-
val = util.get_value_1d(keys, i)
2258+
val = keys[i]
22592259
if val in mapping:
22602260
output[i] = mapping[val]
22612261
else:

pandas/_libs/missing.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from tslibs.nattype cimport is_null_datetimelike
54

pandas/_libs/missing.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from cpython cimport PyFloat_Check, PyComplex_Check
54

pandas/_libs/reduction.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32
from distutils.version import LooseVersion
43

54
from cython cimport Py_ssize_t

pandas/_libs/reshape.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# cython: profile=False
1+
# -*- coding: utf-8 -*-
22

33
cimport cython
44
from cython cimport Py_ssize_t

pandas/_libs/skiplist.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from cython cimport Py_ssize_t
54

pandas/_libs/src/numpy_helper.h

-16
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,4 @@ PANDAS_INLINE PyObject* get_value_1d(PyArrayObject* ap, Py_ssize_t i) {
2828
return PyArray_Scalar(item, PyArray_DESCR(ap), (PyObject*)ap);
2929
}
3030

31-
// returns ASCII or UTF8 (py3) view on python str
32-
// python object owns memory, should not be freed
33-
PANDAS_INLINE const char* get_c_string(PyObject* obj) {
34-
#if PY_VERSION_HEX >= 0x03000000
35-
return PyUnicode_AsUTF8(obj);
36-
#else
37-
return PyString_AsString(obj);
38-
#endif
39-
}
40-
41-
void set_array_not_contiguous(PyArrayObject* ao) {
42-
// Numpy>=1.8-compliant equivalent to:
43-
// ao->flags &= ~(NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_F_CONTIGUOUS);
44-
PyArray_CLEARFLAGS(ao, (NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_F_CONTIGUOUS));
45-
}
46-
4731
#endif // PANDAS__LIBS_SRC_NUMPY_HELPER_H_

pandas/_libs/tslib.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32
from cython cimport Py_ssize_t
43

54
from cpython cimport PyFloat_Check, PyUnicode_Check

pandas/_libs/tslibs/ccalendar.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from cython cimport Py_ssize_t
54

pandas/_libs/tslibs/ccalendar.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32
# cython: boundscheck=False
43
"""
54
Cython implementations of functions resembling the stdlib calendar module

pandas/_libs/tslibs/conversion.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from cpython.datetime cimport datetime, tzinfo
54

pandas/_libs/tslibs/conversion.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
cimport cython
54
from cython cimport Py_ssize_t

pandas/_libs/tslibs/fields.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32
"""
43
Functions for accessing attributes of Timestamp/datetime64/datetime-like
54
objects and arrays

pandas/_libs/tslibs/frequencies.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

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

pandas/_libs/tslibs/nattype.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from numpy cimport int64_t
54
cdef int64_t NPY_NAT

pandas/_libs/tslibs/nattype.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from cpython cimport (
54
PyFloat_Check, PyComplex_Check,

pandas/_libs/tslibs/np_datetime.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from cpython.datetime cimport date, datetime
54

pandas/_libs/tslibs/np_datetime.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from cpython cimport (Py_EQ, Py_NE, Py_GE, Py_GT, Py_LT, Py_LE,
54
PyUnicode_Check, PyUnicode_AsASCIIString)

pandas/_libs/tslibs/timedeltas.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from numpy cimport int64_t
54

pandas/_libs/tslibs/timedeltas.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32
import collections
43
import textwrap
54
import warnings

pandas/_libs/tslibs/timestamps.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from numpy cimport int64_t
54
from np_datetime cimport npy_datetimestruct

pandas/_libs/tslibs/timestamps.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32
import warnings
43

54
from cpython cimport (PyObject_RichCompareBool, PyObject_RichCompare,

pandas/_libs/tslibs/timezones.pxd

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
cdef bint is_utc(object tz)
54
cdef bint is_tzlocal(object tz)

pandas/_libs/tslibs/timezones.pyx

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
# cython: profile=False
32

43
from cython cimport Py_ssize_t
54

0 commit comments

Comments
 (0)