Skip to content

Commit 7a331c9

Browse files
WillAydjreback
authored andcommitted
Removed compat_helper.h (#29693)
1 parent b5371e4 commit 7a331c9

File tree

3 files changed

+8
-63
lines changed

3 files changed

+8
-63
lines changed

pandas/_libs/internals.pyx

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
import cython
22
from cython import Py_ssize_t
33

4-
from cpython.object cimport PyObject
4+
from cpython.slice cimport PySlice_GetIndicesEx
55

66
cdef extern from "Python.h":
77
Py_ssize_t PY_SSIZE_T_MAX
88

99
import numpy as np
1010
from numpy cimport int64_t
1111

12-
cdef extern from "compat_helper.h":
13-
cdef int slice_get_indices(PyObject* s, Py_ssize_t length,
14-
Py_ssize_t *start, Py_ssize_t *stop,
15-
Py_ssize_t *step,
16-
Py_ssize_t *slicelength) except -1
17-
18-
1912
from pandas._libs.algos import ensure_int64
2013

2114

@@ -258,8 +251,8 @@ cpdef Py_ssize_t slice_len(
258251
if slc is None:
259252
raise TypeError("slc must be slice")
260253

261-
slice_get_indices(<PyObject *>slc, objlen,
262-
&start, &stop, &step, &length)
254+
PySlice_GetIndicesEx(slc, objlen,
255+
&start, &stop, &step, &length)
263256

264257
return length
265258

@@ -278,8 +271,8 @@ cdef slice_get_indices_ex(slice slc, Py_ssize_t objlen=PY_SSIZE_T_MAX):
278271
if slc is None:
279272
raise TypeError("slc should be a slice")
280273

281-
slice_get_indices(<PyObject *>slc, objlen,
282-
&start, &stop, &step, &length)
274+
PySlice_GetIndicesEx(slc, objlen,
275+
&start, &stop, &step, &length)
283276

284277
return start, stop, step, length
285278

pandas/_libs/src/compat_helper.h

-45
This file was deleted.

setup.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ def is_platform_mac():
8383

8484

8585
_pxi_dep_template = {
86-
"algos": [
87-
"_libs/algos_common_helper.pxi.in",
88-
"_libs/algos_take_helper.pxi.in",
89-
],
86+
"algos": ["_libs/algos_common_helper.pxi.in", "_libs/algos_take_helper.pxi.in"],
9087
"hashtable": [
9188
"_libs/hashtable_class_helper.pxi.in",
9289
"_libs/hashtable_func_helper.pxi.in",
@@ -544,7 +541,7 @@ def srcpath(name=None, suffix=".pyx", subdir="src"):
544541
ts_include = ["pandas/_libs/tslibs/src", "pandas/_libs/tslibs"]
545542

546543

547-
lib_depends = ["pandas/_libs/src/parse_helper.h", "pandas/_libs/src/compat_helper.h"]
544+
lib_depends = ["pandas/_libs/src/parse_helper.h"]
548545

549546
np_datetime_headers = [
550547
"pandas/_libs/tslibs/src/datetime/np_datetime.h",
@@ -823,5 +820,5 @@ def srcpath(name=None, suffix=".pyx", subdir="src"):
823820
entry_points={
824821
"pandas_plotting_backends": ["matplotlib = pandas:plotting._matplotlib"]
825822
},
826-
**setuptools_kwargs
823+
**setuptools_kwargs,
827824
)

0 commit comments

Comments
 (0)