-
Notifications
You must be signed in to change notification settings - Fork 1
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
Sourcery refactored master branch #1
base: master
Are you sure you want to change the base?
Conversation
e5ff2ce
to
d020a29
Compare
112b4ed
to
9e56be5
Compare
9e56be5
to
a17e0cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sourcery recommends the following changes
a17e0cd
to
92a5859
Compare
@@ -50,10 +50,7 @@ | |||
DISK_FOUR_COUNTS = np.zeros([HEIGHT, WIDTH], int) | |||
for row in range(HEIGHT): | |||
for column in range(WIDTH): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 53-56 refactored with the following changes:
- Convert for loop into list comprehension
@@ -106,10 +106,10 @@ def variables(self): | |||
self.scope + '/') | |||
|
|||
def assign(self, other): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function BaseNetwork.assign refactored with the following changes:
- Convert for loop into list comprehension
- Inline variable that is only used once
@@ -141,8 +141,7 @@ def train_games(self, opponent, games): | |||
|
|||
def process_results(self, opponent, games, step, summary): | |||
win_rate = np.mean([game.policy_player_score for game in games]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function PolicyTraining.process_results refactored with the following changes:
- Replace unneeded comprehension with generator
@@ -263,10 +262,7 @@ def move(self, move, policy_player_turn=False): | |||
self.positions.append(self.position) | |||
if self.position.gameover(): | |||
self.result = self.position.result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function Game.move refactored with the following changes:
- Replace if statement with if expression
@@ -10,7 +10,7 @@ def find_previous_run(dir): | |||
if os.path.isdir(dir): | |||
runs = [child[4:] for child in os.listdir(dir) if child[:4] == 'run_'] | |||
if runs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function run_directory.find_previous_run refactored with the following changes:
- Replace unneeded comprehension with generator
Branch
master
refactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
To manually merge these changes, make sure you're on the
master
branch, then run:See our documentation for configuring or disabling Sourcery.