facebookresearch / nle

The NetHack Learning Environment
Other
939 stars 113 forks source link

Enable the choice of action space #363

Open luigiquara opened 10 months ago

luigiquara commented 10 months ago

This fixes an error occurring when specifying an action space in the creation of the environment. To reproduce the error:

actions = tuple(nle.nethack.CompassDirection)
env = gym.make('NetHackChallenge-v0', actions=actions)

Error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/lquarantiello/miniconda3/envs/nle/lib/python3.8/site-packages/gym/envs/registration.py", line 676, in make
    return registry.make(id, **kwargs)
  File "/home/lquarantiello/miniconda3/envs/nle/lib/python3.8/site-packages/gym/envs/registration.py", line 520, in make
    return spec.make(**kwargs)
  File "/home/lquarantiello/miniconda3/envs/nle/lib/python3.8/site-packages/gym/envs/registration.py", line 140, in make
    env = cls(**_kwargs)
  File "/home/lquarantiello/miniconda3/envs/nle/lib/python3.8/site-packages/nle/env/tasks.py", line 328, in __init__
    super().__init__(
TypeError: __init__() got multiple values for keyword argument 'actions'
facebook-github-bot commented 10 months ago

Hi @luigiquara!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!