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

Add type hints to DQN and its dependencies #17

Merged
merged 7 commits into from
Sep 8, 2020
Merged

Add type hints to DQN and its dependencies #17

merged 7 commits into from
Sep 8, 2020

Conversation

muupan
Copy link
Member

@muupan muupan commented Jul 5, 2020

depends on #16

Adding type hints required some code changes as well. I think these are good changes.

  • Define ActionValue.__getitem__
  • Define AbstractReplayBuffer.capacity
  • Move stop_current_episode from AbstractEpisodicReplayBuffer to AbstractReplayBuffer.
  • Before this PR, self.target_model is initialized as None and assigned by sync_target_network later. After this PR, it cannot be None anymore.

@muupan muupan changed the title [WIP] Add type hints to DQN and its dependencies Add type hints to DQN and its dependencies Jul 6, 2020
@ummavi ummavi self-assigned this Aug 5, 2020
Copy link
Member

@ummavi ummavi left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! A general recommendation I want to discuss is collapsing the from typing ... imports into a single line (or few lines). Especially for the dqn.py which is already quite sizable.
Since we've done this a few other places I suppose we don't have any style guides against it.

@muupan
Copy link
Member Author

muupan commented Sep 8, 2020

Fixed conflicts.

We agreed that we will introduce isort, which automatically merge import sentences. It will be addressed by #53.

Copy link
Member

@ummavi ummavi left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@ummavi ummavi merged commit e64f766 into master Sep 8, 2020
@ummavi ummavi deleted the dqn-type-hint branch September 8, 2020 05:41
@muupan muupan added the enhancement New feature or request label Dec 14, 2020
@muupan muupan added this to the v0.2.0 milestone Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants