Skip to content

Commit b968ce5

Browse files
authored
REF: Move sas pyx files to _libs (#53297)
1 parent aaf5037 commit b968ce5

File tree

11 files changed

+21
-89
lines changed

11 files changed

+21
-89
lines changed
File renamed without changes.
File renamed without changes.

pandas/_libs/meson.build

+2
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ libs_sources = {
103103
'ops_dispatch': {'sources': ['ops_dispatch.pyx']},
104104
'properties': {'sources': ['properties.pyx']},
105105
'reshape': {'sources': ['reshape.pyx']},
106+
'sas': {'sources': ['sas.pyx']},
107+
'byteswap': {'sources': ['byteswap.pyx']},
106108
'sparse': {'sources': ['sparse.pyx', _sparse_op_helper]},
107109
'tslib': {'sources': ['tslib.pyx'],
108110
'include_dirs': inc_datetime},
File renamed without changes.
File renamed without changes.

pandas/io/meson.build

-36
This file was deleted.

pandas/io/sas/meson.build

-34
This file was deleted.

pandas/io/sas/sas7bdat.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@
2828

2929
import numpy as np
3030

31+
from pandas._libs.byteswap import (
32+
read_double_with_byteswap,
33+
read_float_with_byteswap,
34+
read_uint16_with_byteswap,
35+
read_uint32_with_byteswap,
36+
read_uint64_with_byteswap,
37+
)
38+
from pandas._libs.sas import (
39+
Parser,
40+
get_subheader_index,
41+
)
3142
from pandas.errors import (
3243
EmptyDataError,
3344
OutOfBoundsDatetime,
@@ -40,17 +51,6 @@
4051
)
4152

4253
from pandas.io.common import get_handle
43-
from pandas.io.sas._byteswap import (
44-
read_double_with_byteswap,
45-
read_float_with_byteswap,
46-
read_uint16_with_byteswap,
47-
read_uint32_with_byteswap,
48-
read_uint64_with_byteswap,
49-
)
50-
from pandas.io.sas._sas import (
51-
Parser,
52-
get_subheader_index,
53-
)
5454
import pandas.io.sas.sas_constants as const
5555
from pandas.io.sas.sasreader import ReaderBase
5656

pandas/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ inc_datetime = include_directories('_libs/tslibs')
1313
fs.copyfile('__init__.py')
1414

1515
subdir('_libs')
16-
subdir('io')
1716

1817
subdirs_list = [
1918
'_config',
@@ -24,6 +23,7 @@ subdirs_list = [
2423
'compat',
2524
'core',
2625
'errors',
26+
'io',
2727
'plotting',
2828
'tests',
2929
'tseries',

pandas/tests/io/sas/test_byteswap.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
import numpy as np
88
import pytest
99

10-
import pandas._testing as tm
11-
12-
from pandas.io.sas._byteswap import (
10+
from pandas._libs.byteswap import (
1311
read_double_with_byteswap,
1412
read_float_with_byteswap,
1513
read_uint16_with_byteswap,
1614
read_uint32_with_byteswap,
1715
read_uint64_with_byteswap,
1816
)
1917

18+
import pandas._testing as tm
19+
2020

2121
@given(read_offset=st.integers(0, 11), number=st.integers(min_value=0))
2222
@example(number=2**16, read_offset=0)

setup.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ class CheckSDist(sdist_class):
225225
"pandas/_libs/tslibs/vectorized.pyx",
226226
"pandas/_libs/window/indexers.pyx",
227227
"pandas/_libs/writers.pyx",
228-
"pandas/io/sas/sas.pyx",
229-
"pandas/io/sas/byteswap.pyx",
228+
"pandas/_libs/sas.pyx",
229+
"pandas/_libs/byteswap.pyx",
230230
]
231231

232232
_cpp_pyxfiles = [
@@ -558,8 +558,8 @@ def srcpath(name=None, suffix=".pyx", subdir="src"):
558558
},
559559
"_libs.window.indexers": {"pyxfile": "_libs/window/indexers"},
560560
"_libs.writers": {"pyxfile": "_libs/writers"},
561-
"io.sas._sas": {"pyxfile": "io/sas/sas"},
562-
"io.sas._byteswap": {"pyxfile": "io/sas/byteswap"},
561+
"_libs.sas": {"pyxfile": "_libs/sas"},
562+
"_libs.byteswap": {"pyxfile": "_libs/byteswap"},
563563
}
564564

565565
extensions = []

0 commit comments

Comments
 (0)