ClementPerroud / Gym-Trading-Env

A simple, easy, customizable Gymnasium environment for trading.
https://gym-trading-env.readthedocs.io/
MIT License
270 stars 56 forks source link

Don't terminate on warnings #12

Open sebnapi opened 10 months ago

sebnapi commented 10 months ago

This drove me crazy, there are many deprecation warnings with tensorflow and numpy, especially because you don't specify any versions or requirements. This line was the problem:

https://github.com/ClementPerroud/Gym-Trading-Env/blob/6d7b773b3ef4172fe5b2251b25f5d0f6557a3a42/src/gym_trading_env/environments.py#L14-L15

Over night the code stopped working and I have no clue why it worked before. But removing the termination on warning helped run it again.

JakovGlavac commented 2 months ago

BTW this didn't work for me so I needed to add warnings.filterwarnings("ignore", category=DeprecationWarning) below

Then it looks like this:

import warnings
warnings.filterwarnings("error")
warnings.filterwarnings("ignore", category=DeprecationWarning)