Skip to content

Make khash its own extension #18472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pandas/_libs/src/khash.pxd → pandas/_libs/khash.pxd
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- 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
2 changes: 1 addition & 1 deletion pandas/_libs/tslibs/resolution.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ np.import_array()

from util cimport is_string_object, get_nat

from khash cimport (
from pandas._libs.khash cimport (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can do relative imports here?

from ..khash cimport ? not sure. but this is ok for now.

khiter_t,
kh_destroy_int64, kh_put_int64,
kh_init_int64, kh_int64_t,
Expand Down
8 changes: 3 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def pxd(name):
'pyxfile': '_libs/hashing'},
'_libs.hashtable': {
'pyxfile': '_libs/hashtable',
'pxdfiles': ['_libs/hashtable', '_libs/missing'],
'pxdfiles': ['_libs/hashtable', '_libs/missing', '_libs/khash'],
'depends': (['pandas/_libs/src/klib/khash_python.h'] +
_pxi_dep['hashtable'])},
'_libs.index': {
Expand Down Expand Up @@ -550,7 +550,6 @@ def pxd(name):
'_libs.tslib': {
'pyxfile': '_libs/tslib',
'pxdfiles': ['_libs/src/util',
'_libs/src/khash',
'_libs/tslibs/conversion',
'_libs/tslibs/timedeltas',
'_libs/tslibs/timestamps',
Expand Down Expand Up @@ -591,12 +590,11 @@ def pxd(name):
'sources': np_datetime_sources},
'_libs.tslibs.parsing': {
'pyxfile': '_libs/tslibs/parsing',
'pxdfiles': ['_libs/src/util',
'_libs/src/khash']},
'pxdfiles': ['_libs/src/util']},
'_libs.tslibs.resolution': {
'pyxfile': '_libs/tslibs/resolution',
'pxdfiles': ['_libs/src/util',
'_libs/src/khash',
'_libs/khash',
'_libs/tslibs/frequencies',
'_libs/tslibs/timezones'],
'depends': tseries_depends,
Expand Down