Skip to content

Conversation

@ManavR123
Copy link

Address #2190

I simply add a check in NPO init to see if max_episode_length is None and if it is, I raise a ValueError.

Discussed with @ryanjulian

@ManavR123 ManavR123 requested a review from a team as a code owner December 4, 2020 21:47
@ManavR123 ManavR123 requested review from ryanjulian and removed request for a team December 4, 2020 21:47
@mergify mergify bot requested review from a team, maliesa96 and ziyiwu9494 and removed request for a team December 4, 2020 21:48
self.policy = policy
self._scope = scope
self.max_episode_length = env_spec.max_episode_length
if self.max_episode_length == None:
Copy link
Member

Choose a reason for hiding this comment

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

please place this validation above the long list of property initializations (i.e. first lines of this method), and put a newline after the if statement

self._scope = scope
self.max_episode_length = env_spec.max_episode_length
if self.max_episode_length == None:
raise ValueError("max_episode_length must not be None")
Copy link
Member

Choose a reason for hiding this comment

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

we use single quotes in this repo. we have an automated tool called pre-commit which will check your PR for small issues like this and tell you how to fix them (or you can check the CI results below, which will also tell you what to fix).

See the guide here: https://garage.readthedocs.io/en/latest/user/preparing_a_pr.html and https://garage.readthedocs.io/en/latest/user/git_workflow.html#passing-the-pre-commit-hooks

@ManavR123 ManavR123 requested review from ryanjulian and removed request for a team December 5, 2020 02:39
@mergify mergify bot requested a review from a team December 5, 2020 02:40
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