Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix docs tictacto dummy vector env #669 #749

Merged

Conversation

5cat
Copy link
Contributor

@5cat 5cat commented Sep 25, 2022

a fix for #669

  • I have marked all applicable categories:
    • exception-raising fix
    • algorithm implementation fix
    • documentation modification
    • new feature
  • I have reformatted the code using make format (required)
  • I have checked the code using make commit-checks (required)
  • If applicable, I have mentioned the relevant/related issue(s)
  • If applicable, I have listed every items in this Pull Request below

@@ -428,6 +428,7 @@ With the above preparation, we are close to the first learned agent. The followi
agent_opponent: Optional[BasePolicy] = None,
) -> None:
env = get_env()
env = DummyVectorEnv([lambda: env])
Copy link
Collaborator

@Trinkle23897 Trinkle23897 Sep 25, 2022

Choose a reason for hiding this comment

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

In collector, it will automatically wrap the single instance env to vector env, see

if isinstance(env, gym.Env) and not hasattr(env, "__len__"):
warnings.warn("Single environment detected, wrap to DummyVectorEnv.")
self.env = DummyVectorEnv([lambda: env]) # type: ignore

So you should modify this line instead of documentation to

        if isinstance(env, (gym.Env, PettingZooEnv)) and not hasattr(env, "__len__"):

@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2022

Codecov Report

Merging #749 (95eccaf) into master (128feb6) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #749   +/-   ##
=======================================
  Coverage   91.60%   91.60%           
=======================================
  Files          70       70           
  Lines        4934     4934           
=======================================
  Hits         4520     4520           
  Misses        414      414           
Flag Coverage Δ
unittests 91.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Trinkle23897 Trinkle23897 merged commit 0181fe7 into thu-ml:master Oct 4, 2022
BFAnas pushed a commit to BFAnas/tianshou that referenced this pull request May 5, 2024
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.

3 participants