AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.48k stars 2.31k forks source link

fix Poetry dependency #988

Closed dancju closed 1 year ago

dancju commented 1 year ago

The backtesting results of all models did not outperform the benchmark. Did I do something wrong?

zhumingpassional commented 1 year ago

thanks for your effort have you tested it? in software engineering, we hope that a PR only solves a problem for review. could you pls split this PR to several PRs?

dancju commented 1 year ago

Hi @zhumingpassional,

I upgraded Python to 3.10 and Gym to Gymnasium in order to fix the dependency issue. Environment classes were upgraded because the API for reset() and step() was changed. Therefore, I don't think we should split them into multiple PRs.

I was running Stock_NeurIPS2018_3_Backtest.ipynb to test the new dependency and updated env classes. I can but I don't think it's a good idea to split the test into another PR.

After the fix of this PR, you should be able to install dependencies simply with poetry install and run Stock_NeurIPS2018_3_Backtest.ipynb with zero error.

ZiyiXia commented 1 year ago

Hi @dancju Thanks for your commits. I just tested the updates, and will do few more. If no errors are found, I will merge the PR soon.

zhumingpassional commented 1 year ago

it raises errors in the notebook Stock_NeurIPS2018_SB3.ipynb the PR will be merged after multiple tests this PR will be reverted considering of error could you pls revise the PR and submit it again?

image
dancju commented 1 year ago

pyfolio is no longer maintained since Quantopian shut down in 2020, which is why I removed it from pyproject.toml. I have put it back and will create a new PR.

lcavalie commented 1 year ago

Does that mean we need to upgrade python to 3.10 to be able to use Gymnasium instead of Gym?

dancju commented 1 year ago

@lcavalie You can try yourself.

Edit pyproject.toml. Change from python = "~3.10" to python = "~3.9".

poetry env use 3.9
poetry lock
poetry install