Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1a3018a

Browse filesBrowse files
authored
Merge pull request #28961 from jorenham/np.compat
DEP: finalize removal of ``numpy.compat``
2 parents 28247e5 + 55cab76 commit 1a3018a
Copy full SHA for 1a3018a

File tree

Expand file treeCollapse file tree

11 files changed

+3
-185
lines changed
Filter options
Expand file treeCollapse file tree

11 files changed

+3
-185
lines changed
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Removed the ``np.compat`` package source code (removed in 2.0)

‎numpy/__init__.py

Copy file name to clipboardExpand all lines: numpy/__init__.py
+1-1Lines 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

Copy file name to clipboardExpand all lines: numpy/_expired_attrs_2_0.py
-1Lines 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/_expired_attrs_2_0.pyi

Copy file name to clipboardExpand all lines: numpy/_expired_attrs_2_0.pyi
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class _ExpiredAttributesType(TypedDict):
1818
add_newdoc: str
1919
add_docstring: str
2020
add_newdoc_ufunc: str
21-
compat: str
2221
safe_eval: str
2322
float_: str
2423
complex_: str

‎numpy/compat/__init__.py

Copy file name to clipboardExpand all lines: numpy/compat/__init__.py
-29Lines changed: 0 additions & 29 deletions
This file was deleted.

‎numpy/compat/py3k.py

Copy file name to clipboardExpand all lines: numpy/compat/py3k.py
-144Lines changed: 0 additions & 144 deletions
This file was deleted.

‎numpy/compat/tests/__init__.py

Copy file name to clipboardExpand all lines: numpy/compat/tests/__init__.py
Whitespace-only changes.

‎numpy/conftest.py

Copy file name to clipboardExpand all lines: numpy/conftest.py
-2Lines 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

Copy file name to clipboardExpand all lines: numpy/lib/_iotools.py
+1-2Lines 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

Copy file name to clipboardExpand all lines: numpy/meson.build
-1Lines 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

Copy file name to clipboardExpand all lines: numpy/tests/test_public_api.py
-4Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.