AI4Finance-Foundation / FinRL

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

Incorporated optimizations and improvements #1095

Closed mmmarchetti closed 1 year ago

mmmarchetti commented 1 year ago

I am facing difficulties with debugs because of the general exceptions. So I have implemented more specific exceptions to help code debug. And some more changes:

  1. Improved function signatures with type hints for clarity.
  2. Enhanced variable initialization for efficiency.
  3. Utilized a 'max_steps' variable for loop iteration.
  4. Clarified early termination conditions with a descriptive message.
  5. Introduced separation of concerns for code modularity.
  6. Raised more specific exceptions for error handling.
  7. Provided informative error messages for better debugging.

These changes optimize the code for readability, maintainability, and efficiency. I have tested and worked correctly.