Skip to content

Conversation

@cameronangliss
Copy link
Contributor

@cameronangliss cameronangliss commented Jul 12, 2025

This cleans up some benign but concerning-looking CRITICAL logs when running examples/reinforcement_learning.py. Note that when we run the example file, we still get a stream of WARNING logs because the example does not include action masking to ensure that the chosen action is valid. This is expected and good behavior as we have set strict=False in the example, and the warning no longer shows up once you have #762, as an action mask is automatically generated by the environment and used in the example code, thereby avoiding the need to set strict=False.

Instead of one player sending /forfeit and the other sending /default, which sometimes results in the default-sending player getting a showdown warning that the game is already over and it can't make a decision, we now just send /forfeit from one player and nothing from the other. Also, a benign username overlap was resolved in the example code by setting start_listening=False on the opponent Player object.

@codecov
Copy link

codecov bot commented Jul 12, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.95%. Comparing base (f458350) to head (a62256b).
⚠️ Report is 188 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #750      +/-   ##
==========================================
+ Coverage   83.38%   84.95%   +1.57%     
==========================================
  Files          39       46       +7     
  Lines        3918     5304    +1386     
==========================================
+ Hits         3267     4506    +1239     
- Misses        651      798     +147     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cameronangliss cameronangliss marked this pull request as ready for review July 16, 2025 22:11
@cameronangliss cameronangliss changed the title Cleaner forced exit Cleaner env forfeiting Jul 16, 2025
@hsahovic hsahovic merged commit 135ba04 into hsahovic:master Sep 5, 2025
8 of 9 checks passed
@cameronangliss cameronangliss deleted the cleaner-forced-exit branch September 5, 2025 04:35
caymansimpson pushed a commit to caymansimpson/poke-env that referenced this pull request Sep 6, 2025
* improvements to help example not throw benign but concerning-looking errors ("game is not over")

* unused import

* fix mypy

* much better way of doing this with new _EmptyBattleOrder

* format

* simplify

* slight adjustment

* unused import
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants