Upload hf_env/lib/python3.14/site-packages/numpy/core/_utils.py with huggingface_hub
Browse files
hf_env/lib/python3.14/site-packages/numpy/core/_utils.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import warnings
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
def _raise_warning(attr: str, submodule: str | None = None) -> None:
|
| 5 |
+
new_module = "numpy._core"
|
| 6 |
+
old_module = "numpy.core"
|
| 7 |
+
if submodule is not None:
|
| 8 |
+
new_module = f"{new_module}.{submodule}"
|
| 9 |
+
old_module = f"{old_module}.{submodule}"
|
| 10 |
+
warnings.warn(
|
| 11 |
+
f"{old_module} is deprecated and has been renamed to {new_module}. "
|
| 12 |
+
"The numpy._core namespace contains private NumPy internals and its "
|
| 13 |
+
"use is discouraged, as NumPy internals can change without warning in "
|
| 14 |
+
"any release. In practice, most real-world usage of numpy.core is to "
|
| 15 |
+
"access functionality in the public NumPy API. If that is the case, "
|
| 16 |
+
"use the public NumPy API. If not, you are using NumPy internals. "
|
| 17 |
+
"If you would still like to access an internal attribute, "
|
| 18 |
+
f"use {new_module}.{attr}.",
|
| 19 |
+
DeprecationWarning,
|
| 20 |
+
stacklevel=3
|
| 21 |
+
)
|