Affected File
python/Graphs/multi_heuristic_astar.py:82
Current Code
def do_something(back_pointer, goal, start):
grid = np.char.chararray((n, n))
for i in range(n):
for j in range(n):
grid[i][j] = "*"
...
Root Cause
numpy.char.chararray was deprecated in numpy 2.5.0 (numpy/numpy#30605). Constructing a chararray via np.char.chararray((n, n)) now emits:
DeprecationWarning: The chararray class is deprecated
The constructor is called each time do_something runs, which means the warning fires repeatedly during the search algorithm's execution.
Impact
- Severity: Medium — every call to
do_something produces a DeprecationWarning on stderr, accumulating noise as the pathfinding algorithm iterates
Solution
Use a regular numpy array with a string dtype instead:
# Before:
grid = np.char.chararray((n, n))
# After:
grid = np.full((n, n), "*", dtype="<U1")
References
Thank you for taking a look! We would appreciate a confirmation on whether this is a real compatibility issue. Hope it's worth fixing in a future release.
Affected File
python/Graphs/multi_heuristic_astar.py:82Current Code
Root Cause
numpy.char.chararraywas deprecated in numpy 2.5.0 (numpy/numpy#30605). Constructing a chararray vianp.char.chararray((n, n))now emits:The constructor is called each time
do_somethingruns, which means the warning fires repeatedly during the search algorithm's execution.Impact
do_somethingproduces aDeprecationWarningon stderr, accumulating noise as the pathfinding algorithm iteratesSolution
Use a regular numpy array with a string dtype instead:
References
Thank you for taking a look! We would appreciate a confirmation on whether this is a real compatibility issue. Hope it's worth fixing in a future release.