Skip to content

Improve error handling, fix compatibility issues, add test coverage#1384

Open
nickcottrell wants to merge 6 commits intoAI4Finance-Foundation:masterfrom
nickcottrell:fix/error-handling-and-tests
Open

Improve error handling, fix compatibility issues, add test coverage#1384
nickcottrell wants to merge 6 commits intoAI4Finance-Foundation:masterfrom
nickcottrell:fix/error-handling-and-tests

Conversation

@nickcottrell
Copy link
Copy Markdown

@nickcottrell nickcottrell commented Nov 14, 2025

ready in PR_SUBMISSION.txt

This PR improves code quality and reliability across FinRL. It removes bare exception handlers that previously hid critical failures (including in paper trading), restores a missing import needed for hyperparameter optimization, and updates deprecated pandas syntax for pandas 2.0+ compatibility. It also completes the migration from gym to gymnasium.

The PR adds 31 targeted tests for StockTradingEnv, increasing coverage by 64%. All updates remain backwards compatible and include documentation to help maintainers validate the fixes and run the test suite.

Nick Cottrell and others added 6 commits November 14, 2025 08:26
- Replace bare except clauses with specific exception types
- Fix missing linear_schedule function import
- Update pandas fillna to modern API
- Complete gym to gymnasium migration
- Add comprehensive StockTradingEnv test suite
- Explains all 4 bugs fixed with code examples
- Provides step-by-step test execution instructions
- Documents test coverage details for each test class
- Includes manual verification steps
- Shows coverage metrics improvements
- Automated setup script for test environment
- Quick start guide with dependency workarounds
- Documents known dependency conflicts with alpaca-trade-api
- Provides multiple options for running tests
Remove unused local variables in test_stocktrading.py to resolve F841
flake8 errors. All pre-commit hooks now pass for PR files.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant