Skip to content

Commit 6100a76

Browse files
committed
COMPAT: fix .xpt, .dta to all lowercase
DEPR: remove test in categorical for deprecation of .labels
1 parent 9259a56 commit 6100a76

File tree

10 files changed

+18
-20
lines changed

10 files changed

+18
-20
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Thumbs.db
6666
# Data files #
6767
##############
6868
*.dta
69+
*.xpt
6970
*.h5
7071
pandas/io/*.dat
7172
pandas/io/*.json

doc/source/whatsnew/v0.18.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Highlights include:
2323
- API breaking ``.resample`` changes to make it more ``.groupby`` like, see :ref:`here <whatsnew_0180.breaking.resample>`.
2424
- Removal of support for deprecated float indexers; these will now raise a ``TypeError``, see :ref:`here <whatsnew_0180.enhancements.float_indexers>`.
2525
- The ``.to_xarray()`` function has been added for compatibility with the `xarray package <http://xarray.pydata.org/en/stable/>`__, see :ref:`here <whatsnew_0180.enhancements.xarray>`.
26-
- Addition of the :ref:`.str.extractall() method <whatsnew_0180.enhancements.extract>`, and API changes to the :ref:`.str.extract() method <whatsnew_0180.enhancements.extract>` and :ref:`.str.cat() method <whatsnew_0180.enhancements.strcat>`.
26+
- Addition of the :ref:`.str.extractall() method <whatsnew_0180.enhancements.extractall>`, and API changes to the :ref:`.str.extract() method <whatsnew_0180.enhancements.extract>` and :ref:`.str.cat() method <whatsnew_0180.enhancements.strcat>`.
2727

2828

2929
Check the :ref:`API Changes <whatsnew_0180.api_breaking>` and :ref:`deprecations <whatsnew_0180.deprecations>` before updating.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

pandas/io/tests/test_sas.py

+14-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import numpy as np
55
import os
66

7-
# CSV versions of test XPT files were obtained using the R foreign library
7+
# CSV versions of test xpt files were obtained using the R foreign library
88

99
# Numbers in a SAS xport file are always float64, so need to convert
1010
# before making comparisons.
@@ -20,16 +20,16 @@ class TestXport(tm.TestCase):
2020

2121
def setUp(self):
2222
self.dirpath = tm.get_data_path()
23-
self.file01 = os.path.join(self.dirpath, "DEMO_G.XPT")
24-
self.file02 = os.path.join(self.dirpath, "SSHSV1_A.XPT")
25-
self.file03 = os.path.join(self.dirpath, "DRXFCD_G.XPT")
23+
self.file01 = os.path.join(self.dirpath, "DEMO_G.xpt")
24+
self.file02 = os.path.join(self.dirpath, "SSHSV1_A.xpt")
25+
self.file03 = os.path.join(self.dirpath, "DRXFCD_G.xpt")
2626
self.file04 = os.path.join(self.dirpath, "paxraw_d_short.xpt")
2727

2828
def test1_basic(self):
29-
# Tests with DEMO_G.XPT (all numeric file)
29+
# Tests with DEMO_G.xpt (all numeric file)
3030

3131
# Compare to this
32-
data_csv = pd.read_csv(self.file01.replace(".XPT", ".csv"))
32+
data_csv = pd.read_csv(self.file01.replace(".xpt", ".csv"))
3333
numeric_as_float(data_csv)
3434

3535
# Read full file
@@ -51,10 +51,10 @@ def test1_basic(self):
5151
tm.assert_frame_equal(data, data_csv)
5252

5353
def test1_index(self):
54-
# Tests with DEMO_G.XPT using index (all numeric file)
54+
# Tests with DEMO_G.xpt using index (all numeric file)
5555

5656
# Compare to this
57-
data_csv = pd.read_csv(self.file01.replace(".XPT", ".csv"))
57+
data_csv = pd.read_csv(self.file01.replace(".xpt", ".csv"))
5858
data_csv = data_csv.set_index("SEQN")
5959
numeric_as_float(data_csv)
6060

@@ -75,9 +75,9 @@ def test1_index(self):
7575
0:10, :], check_index_type=False)
7676

7777
def test1_incremental(self):
78-
# Test with DEMO_G.XPT, reading full file incrementally
78+
# Test with DEMO_G.xpt, reading full file incrementally
7979

80-
data_csv = pd.read_csv(self.file01.replace(".XPT", ".csv"))
80+
data_csv = pd.read_csv(self.file01.replace(".xpt", ".csv"))
8181
data_csv = data_csv.set_index("SEQN")
8282
numeric_as_float(data_csv)
8383

@@ -94,20 +94,20 @@ def test1_incremental(self):
9494
tm.assert_frame_equal(data, data_csv, check_index_type=False)
9595

9696
def test2(self):
97-
# Test with SSHSV1_A.XPT
97+
# Test with SSHSV1_A.xpt
9898

9999
# Compare to this
100-
data_csv = pd.read_csv(self.file02.replace(".XPT", ".csv"))
100+
data_csv = pd.read_csv(self.file02.replace(".xpt", ".csv"))
101101
numeric_as_float(data_csv)
102102

103103
data = XportReader(self.file02).read()
104104
tm.assert_frame_equal(data, data_csv)
105105

106106
def test_multiple_types(self):
107-
# Test with DRXFCD_G.XPT (contains text and numeric variables)
107+
# Test with DRXFCD_G.xpt (contains text and numeric variables)
108108

109109
# Compare to this
110-
data_csv = pd.read_csv(self.file03.replace(".XPT", ".csv"))
110+
data_csv = pd.read_csv(self.file03.replace(".xpt", ".csv"))
111111

112112
data = XportReader(self.file03).read()
113113
tm.assert_frame_equal(data, data_csv)

pandas/io/tests/test_stata.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ def test_dates_invalid_column(self):
571571
def test_105(self):
572572
# Data obtained from:
573573
# http://go.worldbank.org/ZXY29PVJ21
574-
dpath = os.path.join(self.dirpath, 'S4_EDUC1.DTA')
574+
dpath = os.path.join(self.dirpath, 'S4_EDUC1.dta')
575575
df = pd.read_stata(dpath)
576576
df0 = [[1, 1, 3, -2], [2, 1, 2, -2], [4, 1, 1, -2]]
577577
df0 = pd.DataFrame(df0)

pandas/tests/test_categorical.py

-3
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,6 @@ def test_deprecated_labels(self):
14271427
with tm.assert_produces_warning(FutureWarning):
14281428
res = cat.labels
14291429
self.assert_numpy_array_equal(res, exp)
1430-
self.assertFalse(LooseVersion(pd.__version__) >= '0.18')
14311430

14321431
def test_deprecated_levels(self):
14331432
# TODO: levels is deprecated and should be removed in 0.18 or 2017,
@@ -1441,8 +1440,6 @@ def test_deprecated_levels(self):
14411440
res = pd.Categorical([1, 2, 3, np.nan], levels=[1, 2, 3])
14421441
self.assert_numpy_array_equal(res.categories, exp)
14431442

1444-
self.assertFalse(LooseVersion(pd.__version__) >= '0.18')
1445-
14461443
def test_removed_names_produces_warning(self):
14471444

14481445
# 10482

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ def pxd(name):
551551
'tests/data/legacy_pickle/*/*.pickle',
552552
'tests/data/legacy_msgpack/*/*.msgpack',
553553
'tests/data/*.csv*',
554-
'tests/data/*.XPT',
554+
'tests/data/*.xpt',
555555
'tests/data/*.dta',
556556
'tests/data/*.txt',
557557
'tests/data/*.xls',

0 commit comments

Comments
 (0)