---
source: crates/ruff_linter/src/rules/numpy/mod.rs
---
NPY201 [*] `np.DTypePromotionError` will be removed in NumPy 2.0. Use `numpy.exceptions.DTypePromotionError` instead.
 --> NPY201_3.py:4:5
  |
2 |     import numpy as np
3 |
4 |     np.DTypePromotionError
  |     ^^^^^^^^^^^^^^^^^^^^^^
5 |
6 |     np.ModuleDeprecationWarning
  |
help: Replace with `numpy.exceptions.DTypePromotionError`
  |
1 + from numpy.exceptions import DTypePromotionError
2 | def func():
3 |     import numpy as np
4 |
  -     np.DTypePromotionError
5 +     DTypePromotionError
6 |
  |

NPY201 [*] `np.ModuleDeprecationWarning` will be removed in NumPy 2.0. Use `numpy.exceptions.ModuleDeprecationWarning` instead.
 --> NPY201_3.py:6:5
  |
4 |     np.DTypePromotionError
5 |
6 |     np.ModuleDeprecationWarning
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 |
8 |     np.RankWarning
  |
help: Replace with `numpy.exceptions.ModuleDeprecationWarning`
  |
1 + from numpy.exceptions import ModuleDeprecationWarning
2 | def func():
--------------------------------------------------------------------------------
6 |
  -     np.ModuleDeprecationWarning
7 +     ModuleDeprecationWarning
8 |
  |

NPY201 [*] `np.RankWarning` will be removed in NumPy 2.0. Use `numpy.exceptions.RankWarning` on NumPy 2.0, or ignore this warning on earlier versions.
  --> NPY201_3.py:8:5
   |
 6 |     np.ModuleDeprecationWarning
 7 |
 8 |     np.RankWarning
   |     ^^^^^^^^^^^^^^
 9 |
10 |     np.TooHardError
   |
help: Replace with `numpy.exceptions.RankWarning` (requires NumPy 2.0 or greater)
   |
1  + from numpy.exceptions import RankWarning
2  | def func():
--------------------------------------------------------------------------------
8  |
   -     np.RankWarning
9  +     RankWarning
10 |
   |
note: This is an unsafe fix and may change runtime behavior

NPY201 [*] `np.TooHardError` will be removed in NumPy 2.0. Use `numpy.exceptions.TooHardError` instead.
  --> NPY201_3.py:10:5
   |
 8 |     np.RankWarning
 9 |
10 |     np.TooHardError
   |     ^^^^^^^^^^^^^^^
11 |
12 |     np.VisibleDeprecationWarning
   |
help: Replace with `numpy.exceptions.TooHardError`
   |
1  + from numpy.exceptions import TooHardError
2  | def func():
--------------------------------------------------------------------------------
10 |
   -     np.TooHardError
11 +     TooHardError
12 |
   |

NPY201 [*] `np.VisibleDeprecationWarning` will be removed in NumPy 2.0. Use `numpy.exceptions.VisibleDeprecationWarning` instead.
  --> NPY201_3.py:12:5
   |
10 |     np.TooHardError
11 |
12 |     np.VisibleDeprecationWarning
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 |
14 |     np.chararray
   |
help: Replace with `numpy.exceptions.VisibleDeprecationWarning`
   |
1  + from numpy.exceptions import VisibleDeprecationWarning
2  | def func():
--------------------------------------------------------------------------------
12 |
   -     np.VisibleDeprecationWarning
13 +     VisibleDeprecationWarning
14 |
   |

NPY201 [*] `np.chararray` will be removed in NumPy 2.0. Use `numpy.char.chararray` instead.
  --> NPY201_3.py:14:5
   |
12 |     np.VisibleDeprecationWarning
13 |
14 |     np.chararray
   |     ^^^^^^^^^^^^
15 |
16 |     np.format_parser
   |
help: Replace with `numpy.char.chararray`
   |
1  + from numpy.char import chararray
2  | def func():
--------------------------------------------------------------------------------
14 |
   -     np.chararray
15 +     chararray
16 |
   |

NPY201 [*] `np.format_parser` will be removed in NumPy 2.0. Use `numpy.rec.format_parser` instead.
  --> NPY201_3.py:16:5
   |
14 |     np.chararray
15 |
16 |     np.format_parser
   |     ^^^^^^^^^^^^^^^^
   |
help: Replace with `numpy.rec.format_parser`
   |
1  + from numpy.rec import format_parser
2  | def func():
--------------------------------------------------------------------------------
16 |
   -     np.format_parser
17 +     format_parser
   |
