Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
_expired_attrs_2_0.py79 linesDownload Raw Back to numpy
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    "find_common_type":
65        "Use `numpy.promote_types` or `numpy.result_type` instead. "
66        "To achieve semantics for the `scalar_types` argument, use "
67        "`numpy.result_type` and pass the Python values `0`, `0.0`, or `0j`.",
68    "round_": "Use `np.round` instead.",
69    "get_array_wrap": "",
70    "DataSource": "It's still available as `np.lib.npyio.DataSource`.",
71    "nbytes": "Use `np.dtype(<dtype>).itemsize` instead.",
72    "byte_bounds": "Now it's available under `np.lib.array_utils.byte_bounds`",
73    "compare_chararrays":
74        "It's still available as `np.char.compare_chararrays`.",
75    "format_parser": "It's still available as `np.rec.format_parser`.",
76    "alltrue": "Use `np.all` instead.",
77    "sometrue": "Use `np.any` instead.",
78}
79 
codekingpro/portable-devtools · Team Ai