summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorRoss Barnowski <rossbar@berkeley.edu>2021-08-05 13:52:34 +0300
committerRoss Barnowski <rossbar@berkeley.edu>2021-08-05 13:52:34 +0300
commit76639cc60a6a4ee0d7ca3dd1746c2c16367fb154 (patch)
treefb08922baff8f30f904cedd24d700cbaf4fd7d63 /numpy
parentfe6e3afc2862a2734077c3d41d31470c3addc70b (diff)
downloadnumpy-76639cc60a6a4ee0d7ca3dd1746c2c16367fb154.tar.gz
Rm numpy.lib.npyio.mafromtxt.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/lib/npyio.py30
-rw-r--r--numpy/lib/npyio.pyi3
-rw-r--r--numpy/lib/tests/test_io.py11
-rw-r--r--numpy/tests/test_public_api.py1
4 files changed, 1 insertions, 44 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index 08abac0ba..d8adc3cdf 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -27,7 +27,7 @@ from numpy.compat import (
__all__ = [
- 'savetxt', 'loadtxt', 'genfromtxt', 'mafromtxt',
+ 'savetxt', 'loadtxt', 'genfromtxt',
'recfromtxt', 'recfromcsv', 'load', 'save', 'savez',
'savez_compressed', 'packbits', 'unpackbits', 'fromregex', 'DataSource'
]
@@ -2301,34 +2301,6 @@ _genfromtxt_with_like = array_function_dispatch(
)(genfromtxt)
-def mafromtxt(fname, **kwargs):
- """
- Load ASCII data stored in a text file and return a masked array.
-
- .. deprecated:: 1.17
- np.mafromtxt is a deprecated alias of `genfromtxt` which
- overwrites the ``usemask`` argument with `True` even when
- explicitly called as ``mafromtxt(..., usemask=False)``.
- Use `genfromtxt` instead.
-
- Parameters
- ----------
- fname, kwargs : For a description of input parameters, see `genfromtxt`.
-
- See Also
- --------
- numpy.genfromtxt : generic function to load ASCII data.
-
- """
- kwargs['usemask'] = True
- # Numpy 1.17
- warnings.warn(
- "np.mafromtxt is a deprecated alias of np.genfromtxt, "
- "prefer the latter.",
- DeprecationWarning, stacklevel=2)
- return genfromtxt(fname, **kwargs)
-
-
def recfromtxt(fname, **kwargs):
"""
Load ASCII data from a file and return it in a record array.
diff --git a/numpy/lib/npyio.pyi b/numpy/lib/npyio.pyi
index 22e689d79..f69edd564 100644
--- a/numpy/lib/npyio.pyi
+++ b/numpy/lib/npyio.pyi
@@ -96,6 +96,3 @@ def genfromtxt(
): ...
def recfromtxt(fname, **kwargs): ...
def recfromcsv(fname, **kwargs): ...
-
-# NOTE: Deprecated
-# def mafromtxt(fname, **kwargs): ...
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index aa0037d32..02a9789a7 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -2503,17 +2503,6 @@ class TestPathUsage:
data = np.genfromtxt(path)
assert_array_equal(a, data)
- def test_mafromtxt(self):
- # From `test_fancy_dtype_alt` above
- with temppath(suffix='.txt') as path:
- path = Path(path)
- with path.open('w') as f:
- f.write(u'1,2,3.0\n4,5,6.0\n')
-
- test = np.genfromtxt(path, delimiter=',', usemask=True)
- control = ma.array([(1.0, 2.0, 3.0), (4.0, 5.0, 6.0)])
- assert_equal(test, control)
-
def test_recfromtxt(self):
with temppath(suffix='.txt') as path:
path = Path(path)
diff --git a/numpy/tests/test_public_api.py b/numpy/tests/test_public_api.py
index a40275eb7..3fa2edd8f 100644
--- a/numpy/tests/test_public_api.py
+++ b/numpy/tests/test_public_api.py
@@ -45,7 +45,6 @@ def test_numpy_namespace():
'fastCopyAndTranspose': 'numpy.core._multiarray_umath._fastCopyAndTranspose',
'get_array_wrap': 'numpy.lib.shape_base.get_array_wrap',
'get_include': 'numpy.lib.utils.get_include',
- 'mafromtxt': 'numpy.lib.npyio.mafromtxt',
'recfromcsv': 'numpy.lib.npyio.recfromcsv',
'recfromtxt': 'numpy.lib.npyio.recfromtxt',
'safe_eval': 'numpy.lib.utils.safe_eval',