Skip to content

Commit acfdb1d

Browse files
committed
pandas._sparse -> pandas.sparse.libsparse
1 parent 9b5faba commit acfdb1d

File tree

14 files changed

+33
-27
lines changed

14 files changed

+33
-27
lines changed

doc/source/whatsnew/v0.20.0.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ If indicated, a deprecation warning will be issued if you reference that module.
463463
"pandas.io.sas.saslib", "pandas.io.sas.libsas", ""
464464
"pandas.msgpack", "pandas.io.msgpack", ""
465465
"pandas._testing", "pandas.util.libtesting", ""
466+
"pandas._sparse", "pandas.sparse.libsparse", ""
466467

467468

468469
.. _whatsnew_0200.api_breaking.groupby_describe:

pandas/compat/pickle_compat.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ def load_reduce(self):
6161
('pandas.core.base', 'FrozenList'): ('pandas.indexes.frozen', 'FrozenList'),
6262

6363
# 10890
64-
('pandas.core.series', 'TimeSeries'): ('pandas.core.series', 'Series')
64+
('pandas.core.series', 'TimeSeries'): ('pandas.core.series', 'Series'),
65+
66+
# 12588, extensions moving
67+
('pandas._sparse', 'BlockIndex'): ('pandas.sparse.libsparse', 'BlockIndex')
6568
}
6669

6770

pandas/core/reshape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from pandas.core.sparse import SparseDataFrame, SparseSeries
1919
from pandas.sparse.array import SparseArray
20-
from pandas._sparse import IntIndex
20+
from pandas.sparse.libsparse import IntIndex
2121

2222
from pandas.core.categorical import Categorical, _factorize_from_iterable
2323
from pandas.core.sorting import (get_group_index, compress_group_index,

pandas/sparse/array.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
_astype_nansafe, _find_common_type)
2626
from pandas.types.missing import isnull, notnull, na_value_for_dtype
2727

28-
from pandas._sparse import SparseIndex, BlockIndex, IntIndex
29-
import pandas._sparse as splib
28+
from pandas.sparse import libsparse as splib
29+
from pandas.sparse.libsparse import SparseIndex, BlockIndex, IntIndex
3030
import pandas.index as _index
3131
import pandas.core.algorithms as algos
3232
import pandas.core.ops as ops

pandas/sparse/list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from pandas.types.common import is_scalar
77
from pandas.sparse.array import SparseArray
88
from pandas.util.validators import validate_bool_kwarg
9-
import pandas._sparse as splib
9+
import pandas.sparse.libsparse as splib
1010

1111

1212
class SparseList(PandasObject):

pandas/sparse/series.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525

2626
from pandas.sparse.array import (make_sparse, _sparse_array_op, SparseArray,
2727
_make_index)
28-
from pandas._sparse import BlockIndex, IntIndex
29-
import pandas._sparse as splib
28+
from pandas.sparse.libsparse import BlockIndex, IntIndex
29+
import pandas.sparse.libsparse as splib
3030

3131
from pandas.sparse.scipy_sparse import (_sparse_series_to_coo,
3232
_coo_to_sparse_series)
File renamed without changes.

pandas/tests/sparse/test_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
from pandas import _np_version_under1p8
1010
from pandas.sparse.api import SparseArray, SparseSeries
11-
from pandas._sparse import IntIndex
11+
from pandas.sparse.libsparse import IntIndex
1212
from pandas.util.testing import assert_almost_equal, assertRaisesRegexp
1313
import pandas.util.testing as tm
1414

pandas/tests/sparse/test_frame.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from pandas import compat
1515
import pandas.sparse.frame as spf
1616

17-
from pandas._sparse import BlockIndex, IntIndex
17+
from pandas.sparse.libsparse import BlockIndex, IntIndex
1818
from pandas.sparse.api import SparseSeries, SparseDataFrame, SparseArray
1919
from pandas.tests.frame.test_misc_api import SharedWithSparse
2020

pandas/tests/sparse/test_libsparse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from pandas import compat
99

1010
from pandas.sparse.array import IntIndex, BlockIndex, _make_index
11-
import pandas._sparse as splib
11+
import pandas.sparse.libsparse as splib
1212

1313
TEST_LENGTH = 20
1414

pandas/tests/sparse/test_series.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import pandas.sparse.frame as spf
1818

19-
from pandas._sparse import BlockIndex, IntIndex
19+
from pandas.sparse.libsparse import BlockIndex, IntIndex
2020
from pandas.sparse.api import SparseSeries
2121
from pandas.tests.series.test_misc_api import SharedWithSparse
2222

pandas/util/testing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,8 +1413,10 @@ def assert_sp_array_equal(left, right, check_dtype=True):
14131413
check_dtype=check_dtype)
14141414

14151415
# SparseIndex comparison
1416-
assertIsInstance(left.sp_index, pd._sparse.SparseIndex, '[SparseIndex]')
1417-
assertIsInstance(right.sp_index, pd._sparse.SparseIndex, '[SparseIndex]')
1416+
assertIsInstance(left.sp_index,
1417+
pd.sparse.libsparse.SparseIndex, '[SparseIndex]')
1418+
assertIsInstance(right.sp_index,
1419+
pd.sparse.libsparse.SparseIndex, '[SparseIndex]')
14181420

14191421
if not left.sp_index.equals(right.sp_index):
14201422
raise_assert_detail('SparseArray.index', 'index are not equal',

setup.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,20 @@ def is_platform_mac():
109109
from os.path import join as pjoin
110110

111111

112-
_pxipath = pjoin('pandas', 'src')
113112
_pxi_dep_template = {
114-
'algos': ['algos_common_helper.pxi.in', 'algos_groupby_helper.pxi.in',
115-
'algos_take_helper.pxi.in', 'algos_rank_helper.pxi.in'],
116-
'_join': ['join_helper.pxi.in', 'joins_func_helper.pxi.in'],
117-
'hashtable': ['hashtable_class_helper.pxi.in',
118-
'hashtable_func_helper.pxi.in'],
119-
'index': ['index_class_helper.pxi.in'],
120-
'_sparse': ['sparse_op_helper.pxi.in']
113+
'algos': ['src/algos_common_helper.pxi.in', 'src/algos_groupby_helper.pxi.in',
114+
'src/algos_take_helper.pxi.in', 'src/algos_rank_helper.pxi.in'],
115+
'join': ['src/join_helper.pxi.in', 'src/joins_func_helper.pxi.in'],
116+
'hashtable': ['src/hashtable_class_helper.pxi.in',
117+
'src/hashtable_func_helper.pxi.in'],
118+
'index': ['src/index_class_helper.pxi.in'],
119+
'sparse': ['sparse/sparse_op_helper.pxi.in'],
121120
}
121+
122122
_pxifiles = []
123123
_pxi_dep = {}
124124
for module, files in _pxi_dep_template.items():
125-
pxi_files = [pjoin(_pxipath, x) for x in files]
125+
pxi_files = [pjoin('pandas', x) for x in files]
126126
_pxifiles.extend(pxi_files)
127127
_pxi_dep[module] = pxi_files
128128

@@ -335,7 +335,7 @@ class CheckSDist(sdist_class):
335335
'pandas/window.pyx',
336336
'pandas/io/parsers.pyx',
337337
'pandas/src/period.pyx',
338-
'pandas/src/sparse.pyx',
338+
'pandas/sparse/sparse.pyx',
339339
'pandas/util/testing.pyx',
340340
'pandas/src/hash.pyx',
341341
'pandas/io/sas/sas.pyx']
@@ -498,7 +498,7 @@ def pxd(name):
498498
'depends': _pxi_dep['algos']},
499499
'_join': {'pyxfile': 'src/join',
500500
'pxdfiles': ['src/util', 'hashtable'],
501-
'depends': _pxi_dep['_join']},
501+
'depends': _pxi_dep['join']},
502502
'_window': {'pyxfile': 'window',
503503
'pxdfiles': ['src/skiplist', 'src/util'],
504504
'depends': ['pandas/src/skiplist.pyx',
@@ -509,9 +509,9 @@ def pxd(name):
509509
'pandas/src/numpy_helper.h'],
510510
'sources': ['pandas/src/parser/tokenizer.c',
511511
'pandas/src/parser/io.c']},
512-
'_sparse': {'pyxfile': 'src/sparse',
513-
'depends': ([srcpath('sparse', suffix='.pyx')] +
514-
_pxi_dep['sparse'])},
512+
'sparse.libsparse': {'pyxfile': 'sparse/sparse',
513+
'depends': (['pandas/sparse/sparse.pyx'] +
514+
_pxi_dep['sparse'])},
515515
'util.libtesting': {'pyxfile': 'util/testing',
516516
'depends': ['pandas/util/testing.pyx']},
517517
'_hash': {'pyxfile': 'src/hash',

0 commit comments

Comments
 (0)