Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jeguzzi
Copy link
Contributor

@jeguzzi jeguzzi commented May 14, 2025

Description

Set the "state" field in step and reset.

Motivation and Context

The PettingZooWrapper support of (environment) state was limited to configuring the spec. This commit completes it by setting the state in reset and step.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the CONTRIBUTION guide (required)
  • My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).

PettingZooWrapper is currently not tested.

  • I have updated the documentation accordingly.

@pytorch-bot
Copy link

pytorch-bot bot commented May 14, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/rl/2953

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 14, 2025
@vmoens vmoens changed the title Complete PettingZooWrapper state support [Environment] Complete PettingZooWrapper state support May 14, 2025
@vmoens vmoens added the Environments Adds or modifies an environment wrapper label May 14, 2025
Copy link
Collaborator

@vmoens vmoens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks that's amazing. Can you add a quick test in test_libs.py for this feature?

@vmoens
Copy link
Collaborator

vmoens commented May 14, 2025

@matteobettini I guess this slipped through as we don't do a check_env_specs when return_state=True?

@matteobettini
Copy link
Contributor

matteobettini commented May 14, 2025

This is super strange, state should have already been present in resets and step as also benchmarl is using it, let me have a look tonight. I might have missed something major!

@matteobettini
Copy link
Contributor

Holy moly! I did miss something MAJOR!!

Thanks a million for fixing this, I am so ashamed :((((

The chaced zero specs meant that the states are there but they were all zeros that is why me or the checks never got this

jeguzzi and others added 2 commits May 16, 2025 16:56
The `PettingZooWrapper` implementation related to the environment state was limited to configuring the spec.
This commit complete it by setting the state in `reset` and `step`.
@vmoens vmoens force-pushed the PettingZooWrapper-complete-state branch from 4c39068 to 46286b3 Compare May 16, 2025 16:09
@vmoens vmoens merged commit d882ea2 into pytorch:main May 16, 2025
1 check passed
vmoens pushed a commit that referenced this pull request May 16, 2025
Co-authored-by: Vincent Moens <[email protected]>
(cherry picked from commit d882ea2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Environments Adds or modifies an environment wrapper

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants