tl;dr: numpy.bool_ is the new numpy.bool, or as the Numpy 1.20 Deprecation log says, "Just use bool"
I found a thing that will want updating in the future, as I'm running through the v2 tutorial using Python 3.11 and numpy 1.24.2.
Once I get through the entire tutorial and assuming that my changes still work (and as long as I have available time and focus), I can submit a PR. At minimum, that could simply consist of including a note in the text about the difference between what numpy < 1.20 expects and what numpy >= 1.20 expects.
First seen in Part 2, in the file tile_types.py:
# Tile struct used for statically defined tile data.
tile_dt = np.dtype(
[
("walkable", np.bool), # True if this tile can be walked over.
("transparent", np.bool), # True if this tile doesn't block FOV.
("dark", graphic_dt), # Graphics for when this tile is not in FOV.
]
)
Using np.bool here (again, with Python 3.11 & numpy 1.24.2) throws an error:
AttributeError: module 'numpy' has no attribute 'bool'.
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'bool_'?
I tested replacing both instances of np.bool with np.bool_ and also bool in my code and there's no longer any yelling either way.
tl;dr:
numpy.bool_is the newnumpy.bool, or as the Numpy 1.20 Deprecation log says, "Just usebool"I found a thing that will want updating in the future, as I'm running through the v2 tutorial using Python 3.11 and numpy 1.24.2.
Once I get through the entire tutorial and assuming that my changes still work (and as long as I have available time and focus), I can submit a PR. At minimum, that could simply consist of including a note in the text about the difference between what
numpy < 1.20expects and whatnumpy >= 1.20expects.First seen in Part 2, in the file
tile_types.py:Using
np.boolhere (again, with Python 3.11 & numpy 1.24.2) throws an error:I tested replacing both instances of
np.boolwithnp.bool_and alsoboolin my code and there's no longer any yelling either way.