From 282f492c4ad890431a40b455e6717d8453eebae1 Mon Sep 17 00:00:00 2001 From: Sander Land Date: Tue, 5 Jan 2021 17:26:29 +0100 Subject: [PATCH] ancient chinese+black --- katrain/core/game.py | 11 ++--------- katrain/core/game_node.py | 12 +++--------- katrain/gui/badukpan.py | 9 +-------- katrain/gui/kivyutils.py | 6 +----- katrain/gui/widgets/progress_loader.py | 6 +----- 5 files changed, 8 insertions(+), 36 deletions(-) diff --git a/katrain/core/game.py b/katrain/core/game.py index a157ceb..603d78d 100644 --- a/katrain/core/game.py +++ b/katrain/core/game.py @@ -434,11 +434,7 @@ class Game: base_game_name = f"{PROGRAM_NAME}_{player_names['B']} vs {player_names['W']}" return f"{base_game_name} {self.game_id}.sgf" - def write_sgf( - self, - filename: str, - trainer_config: Optional[Dict] = None, - ): + def write_sgf(self, filename: str, trainer_config: Optional[Dict] = None): if trainer_config is None: trainer_config = self.katrain.config("trainer", {}) save_feedback = trainer_config.get("save_feedback", False) @@ -585,10 +581,7 @@ class Game: analyze_and_play_policy(new_node) self.engines[node.next_player].request_analysis( - new_node, - callback=set_analysis, - priority=-1000, - analyze_fast=True, + new_node, callback=set_analysis, priority=-1000, analyze_fast=True ) analyze_and_play_policy(cn) diff --git a/katrain/core/game_node.py b/katrain/core/game_node.py index b446be3..f82cb10 100644 --- a/katrain/core/game_node.py +++ b/katrain/core/game_node.py @@ -8,10 +8,10 @@ from typing import Dict, List, Optional, Tuple from katrain.core.constants import ( ANALYSIS_FORMAT_VERSION, PROGRAM_NAME, + REPORT_DT, SGF_INTERNAL_COMMENTS_MARKER, SGF_SEPARATOR_MARKER, - VERSION, - REPORT_DT, + VERSION ) from katrain.core.lang import i18n from katrain.core.sgf_parser import Move, SGFNode @@ -319,13 +319,7 @@ class GameNode(SGFNode): text += i18n._("Info:point loss").format(points_lost=points_lost) + "\n" top_move = previous_top_move["move"] score = self.format_score(previous_top_move["scoreLead"]) - text += ( - i18n._("Info:top move").format( - top_move=top_move, - score=score, - ) - + "\n" - ) + text += i18n._("Info:top move").format(top_move=top_move, score=score) + "\n" else: text += i18n._("Info:best move") + "\n" if previous_top_move.get("pv") and (sgf or details): diff --git a/katrain/gui/badukpan.py b/katrain/gui/badukpan.py index 6396ae6..1ca6a7b 100644 --- a/katrain/gui/badukpan.py +++ b/katrain/gui/badukpan.py @@ -471,14 +471,7 @@ class BadukPanWidget(Widget): ) if move_policy == best_move_policy: Color(*Theme.TOP_MOVE_BORDER_COLOR[:3], Theme.POLICY_ALPHA) - Line( - circle=( - self.gridpos_x[x], - self.gridpos_y[y], - self.stone_size - dp(1.2), - ), - width=dp(2), - ) + Line(circle=(self.gridpos_x[x], self.gridpos_y[y], self.stone_size - dp(1.2)), width=dp(2)) with pass_btn.canvas.after: move_policy = policy[-1] diff --git a/katrain/gui/kivyutils.py b/katrain/gui/kivyutils.py index bdda6b2..ead2374 100644 --- a/katrain/gui/kivyutils.py +++ b/katrain/gui/kivyutils.py @@ -663,11 +663,7 @@ def cached_text_texture(text, font_name, markup, _cache={}, **kwargs): def draw_text(pos, text, font_name=None, markup=False, **kwargs): texture = cached_text_texture(text, font_name, markup, **kwargs) - Rectangle( - texture=texture, - pos=(pos[0] - texture.size[0] / 2, pos[1] - texture.size[1] / 2), - size=texture.size, - ) + Rectangle(texture=texture, pos=(pos[0] - texture.size[0] / 2, pos[1] - texture.size[1] / 2), size=texture.size) def draw_circle(pos, r, col): diff --git a/katrain/gui/widgets/progress_loader.py b/katrain/gui/widgets/progress_loader.py index 61e1f97..c7f4b14 100644 --- a/katrain/gui/widgets/progress_loader.py +++ b/katrain/gui/widgets/progress_loader.py @@ -71,11 +71,7 @@ class ProgressLoader(BoxLayout): Clock.schedule_once(self.animation_show, 1) def animation_show(self, _dt): - animation = Animation( - opacity=1, - d=0.2, - t="out_quad", - ) + animation = Animation(opacity=1, d=0.2, t="out_quad") animation.start(self) def request_download_file(self, url, path):