1"""
2Dict of expired attributes that are discontinued since 2.0 release.
3Each item is associated with a migration note.
4"""
5
6__expired_attributes__ = {
7 "geterrobj": "Use the np.errstate context manager instead.",
8 "seterrobj": "Use the np.errstate context manager instead.",
9 "cast": "Use `np.asarray(arr, dtype=dtype)` instead.",
10 "source": "Use `inspect.getsource` instead.",
11 "lookfor": "Search NumPy's documentation directly.",
12 "who": "Use an IDE variable explorer or `locals()` instead.",
13 "fastCopyAndTranspose": "Use `arr.T.copy()` instead.",
14 "set_numeric_ops":
15 "For the general case, use `PyUFunc_ReplaceLoopBySignature`. "
16 "For ndarray subclasses, define the ``__array_ufunc__`` method "
17 "and override the relevant ufunc.",
18 "NINF": "Use `-np.inf` instead.",
19 "PINF": "Use `np.inf` instead.",
20 "NZERO": "Use `-0.0` instead.",
21 "PZERO": "Use `0.0` instead.",
22 "add_newdoc":
23 "It's still available as `np.lib.add_newdoc`.",
24 "add_docstring":
25 "It's still available as `np.lib.add_docstring`.",
26 "add_newdoc_ufunc":
27 "It's an internal function and doesn't have a replacement.",
28 "safe_eval": "Use `ast.literal_eval` instead.",
29 "float_": "Use `np.float64` instead.",
30 "complex_": "Use `np.complex128` instead.",
31 "longfloat": "Use `np.longdouble` instead.",
32 "singlecomplex": "Use `np.complex64` instead.",
33 "cfloat": "Use `np.complex128` instead.",
34 "longcomplex": "Use `np.clongdouble` instead.",
35 "clongfloat": "Use `np.clongdouble` instead.",
36 "string_": "Use `np.bytes_` instead.",
37 "unicode_": "Use `np.str_` instead.",
38 "Inf": "Use `np.inf` instead.",
39 "Infinity": "Use `np.inf` instead.",
40 "NaN": "Use `np.nan` instead.",
41 "infty": "Use `np.inf` instead.",
42 "issctype": "Use `issubclass(rep, np.generic)` instead.",
43 "maximum_sctype":
44 "Use a specific dtype instead. You should avoid relying "
45 "on any implicit mechanism and select the largest dtype of "
46 "a kind explicitly in the code.",
47 "obj2sctype": "Use `np.dtype(obj).type` instead.",
48 "sctype2char": "Use `np.dtype(obj).char` instead.",
49 "sctypes": "Access dtypes explicitly instead.",
50 "issubsctype": "Use `np.issubdtype` instead.",
51 "set_string_function":
52 "Use `np.set_printoptions` instead with a formatter for "
53 "custom printing of NumPy objects.",
54 "asfarray": "Use `np.asarray` with a proper dtype instead.",
55 "issubclass_": "Use `issubclass` builtin instead.",
56 "tracemalloc_domain": "It's now available from `np.lib`.",
57 "mat": "Use `np.asmatrix` instead.",
58 "recfromcsv": "Use `np.genfromtxt` with comma delimiter instead.",
59 "recfromtxt": "Use `np.genfromtxt` instead.",
60 "deprecate": "Emit `DeprecationWarning` with `warnings.warn` directly, "
61 "or use `typing.deprecated`.",
62 "deprecate_with_doc": "Emit `DeprecationWarning` with `warnings.warn` "
63 "directly, or use `typing.deprecated`.",
64 "disp": "Use your own printing function instead.",
65 "find_common_type":
66 "Use `numpy.promote_types` or `numpy.result_type` instead. "
67 "To achieve semantics for the `scalar_types` argument, use "
68 "`numpy.result_type` and pass the Python values `0`, `0.0`, or `0j`.",
69 "round_": "Use `np.round` instead.",
70 "get_array_wrap": "",
71 "DataSource": "It's still available as `np.lib.npyio.DataSource`.",
72 "nbytes": "Use `np.dtype(<dtype>).itemsize` instead.",
73 "byte_bounds": "Now it's available under `np.lib.array_utils.byte_bounds`",
74 "compare_chararrays":
75 "It's still available as `np.char.compare_chararrays`.",
76 "format_parser": "It's still available as `np.rec.format_parser`.",
77 "alltrue": "Use `np.all` instead.",
78 "sometrue": "Use `np.any` instead.",
79}