openai / gym

A toolkit for developing and comparing reinforcement learning algorithms.
https://www.gymlibrary.dev
Other
34.2k stars 8.58k forks source link

Updating deprecated alias 'np.bool8' -> 'np.bool_' #3258

Open sebastianbrzustowicz opened 4 months ago

sebastianbrzustowicz commented 4 months ago

Description

Part of code is outdated. I updated one small issue with old alias in numpy. Basically I changed "np.bool8" -> "np.bool_" in 3 places, because otherwise there is a warning when using gym repository. Warning information:

C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\gym\utils\passive_envchecker.py:233: DeprecationWarning: np.bool8 is a deprecated alias for `np.bool`. (Deprecated NumPy 1.24)

Screenshots

My code:

Zrzut ekranu 2024-02-23 050824

Warning:

Zrzut ekranu 2024-02-23 050704

After changes

I took the following steps to check the results of the change:

  1. Uninstalled gym pip uninstall gym

  2. Installed gym from my forked repo with new branch pip install git+https://github.com/sebastianbrzustowicz/gym.git@np.bool_

There is no longer any redundant warning.

Hope I helped a little bit.

pseudo-rnd-thoughts commented 4 months ago

Hey, we just launched gymnasium, a fork of Gym by the maintainers where all maintenance and improvements will happen moving forward. Therefore, we are not updating or maintaining this repo anymore