Skip to content

Commit 788fa24

Browse files
jorenhamMaanasArora
authored andcommitted
MAINT: remove numpy.compat
1 parent 05fd723 commit 788fa24

File tree

9 files changed

+2
-184
lines changed

9 files changed

+2
-184
lines changed

numpy/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ def __dir__():
418418
)
419419
public_symbols -= {
420420
"matrixlib", "matlib", "tests", "conftest", "version",
421-
"compat", "distutils", "array_api"
421+
"distutils", "array_api"
422422
}
423423
return list(public_symbols)
424424

numpy/_expired_attrs_2_0.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"It's still available as `np.lib.add_docstring`.",
2626
"add_newdoc_ufunc":
2727
"It's an internal function and doesn't have a replacement.",
28-
"compat": "There's no replacement, as Python 2 is no longer supported.",
2928
"safe_eval": "Use `ast.literal_eval` instead.",
3029
"float_": "Use `np.float64` instead.",
3130
"complex_": "Use `np.complex128` instead.",

numpy/compat/__init__.py

Lines changed: 0 additions & 29 deletions
This file was deleted.

numpy/compat/py3k.py

Lines changed: 0 additions & 144 deletions
This file was deleted.

numpy/compat/tests/__init__.py

Whitespace-only changes.

numpy/conftest.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ def warnings_errors_and_rng(test=None):
166166
"msvccompiler",
167167
"Deprecated call",
168168
"numpy.core",
169-
"`np.compat`",
170169
"Importing from numpy.matlib",
171170
"This function is deprecated.", # random_integers
172171
"Data type alias 'a'", # numpy.rec.fromfile
@@ -229,7 +228,6 @@ def warnings_errors_and_rng(test=None):
229228
'numpy/_core/cversions.py',
230229
'numpy/_pyinstaller',
231230
'numpy/random/_examples',
232-
'numpy/compat',
233231
'numpy/f2py/_backends/_distutils.py',
234232
]
235233

numpy/lib/_iotools.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
def _decode_line(line, encoding=None):
1313
"""Decode bytes from binary input streams.
1414
15-
Defaults to decoding from 'latin1'. That differs from the behavior of
16-
np.compat.asunicode that decodes from 'ascii'.
15+
Defaults to decoding from 'latin1'.
1716
1817
Parameters
1918
----------

numpy/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ pure_subdirs = [
317317
'_pyinstaller',
318318
'_typing',
319319
'_utils',
320-
'compat',
321320
'ctypeslib',
322321
'doc',
323322
'f2py',

numpy/tests/test_public_api.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ def test_NPY_NO_EXPORT():
162162

163163

164164
PRIVATE_BUT_PRESENT_MODULES = ['numpy.' + s for s in [
165-
"compat",
166-
"compat.py3k",
167165
"conftest",
168166
"core",
169167
"core.multiarray",
@@ -284,8 +282,6 @@ def is_unexpected(name):
284282
SKIP_LIST = ["numpy.distutils.msvc9compiler"]
285283

286284

287-
# suppressing warnings from deprecated modules
288-
@pytest.mark.filterwarnings("ignore:.*np.compat.*:DeprecationWarning")
289285
def test_all_modules_are_expected():
290286
"""
291287
Test that we don't add anything that looks like a new public module by

0 commit comments

Comments
 (0)